XF 2.1 Cannot *render* large image

rfc0001

Well-known member
I'm having an rendering a large image in a post that was successfully uploaded, therefore not due to any size or dimension configuration in XF or PHP.ini. I'm hypothesizing there is hard coded restriction somewhere in XF that causes it to render the ATTACH BBCode as "View attachment xyz.gif" instead of display the attachment inline.

The image is 15.9MB. It's an animated GIF. If I click insert image, upload the file and save post it uplaods fine, but instead of rendering i see a hyperlink that says "view attachment xyz.gif". So the image/attachment uploaded just fine (did not exceed image dimensions or attachment size), but for some reason it won't display in the post.

I can even add a insert a hotlink image to the attachment URL and it displays just fine. XF just won't do it automatically. Also, if I upload the image as an attachment first, I get don't get a insert Full/Thumbnail button after it successfully upload. What gives? Does XF not automatically render images over 15MB or something? Is that configurable? Thanks!
 
Last edited:
check your attachment settings. It usually has a default one that can be adjusted. I say adjust it to the highest level your host has on their server
 
That is set to 50,000,00

GIF is 1024x684 (700,416 pixels), so unless it's counting all the pixels on every frame of the GIF I don't think that's the problem. Also, wouldn't that reject the image on upload? Keep in mind the image is uploading and saving as an attachment just fine. It just isn't rendering (it's rendered by XF as a link). Also, I can even trick XF to render it by adding a hotlink to the attachment URL, which works fine. XF just won't render the image attachment inline it automatically.
 
Last edited:
check your attachment settings. It usually has a default one that can be adjusted. I say adjust it to the highest level your host has on their server
I already adjusted those settings and I'm confident it is not the issue. Those would all result in the image failing to upload. It is uploading just fine, XF just isn't displaying it. FWIW, my settings are:

XF settings
  • Maximum attachment file size: 25,600 KB (image is 16,383 KB)
  • Maximum attachment image dimensions: 1024 x 2048 pixels (image is 1024x684 pixels)
php,ini
  • post_max_size = 100M (image is 16MB)
  • upload_max_filesize = 25M (image is 16MB)
 
XF Settings for attachment image diamensions i think you can change that to allow just the larger size.

I suggest that you're stuck because you have both the maximum file attachment size and the lower attachment dimension size on there.

Try disabling the lower attachment dimension size because that is the issue as it's not letting you post it up on your site.
You said that the GIF image is 1024x684
It's too large. If you disable the dimensions it should work for you.
 
Your host should really have a huge amount of space for attachment sizes so that you can fit all images.
Set it at what they give you.
My own sites (i have two licenses) are set to it's maximum space that my host gave me.
I have no issues with any images whether they are gifs, or whatever they are.
All because i don't worry about filling out the dimensions.
 
I've reproed with all add-ons disabled, so confident this is built in functionality in XF. I tried to upload here to repro but too large for Xenforo Community's settings.
 
Last edited:
Sorry, I should not have said issue inserting image as that made it sound like the issue was on upload. I updated the thread title and my original post to make it clear there are no issues uploading and attaching the image. The issue is in XF rendering the image, e.g. when XF renders:

[ATTACH=full]56537[/ATTACH]

XF is deciding to insert it as a attachment link ("view attachment xyz.gif") vs. inline. It's BB code rendering issue. Apparently XF has some logic built in to not render large images. Has nothing to do with uploading images.
 
Last edited:
What is the file extension on the image?

Sometimes, images have an incorrect file extension, like webp using a gif or jpg extension. Download the Irfanview editor (freeware) and open the file in that: if its a different format it will tell you.
 
It's a .gif and is actually a GIF as that is the only image format that supports animation.

Also I can insert the ATTACHMENT url as an image and it renders fine, so it's not an image or upload issue. It's purely how XF decides to render the image as a URL instead of an inline image. It's not a broken image link or anything like that. XF is explictly outputting the ATTTACH tag inline as a link formatted as "View attachement xyz.gif" (not an attachment). That has to be hard coded in XF.
 
I am getting the same issue on XF 2.1.10 patch 2.

Maximum attachment image dimensions are blank meaning unlimited.

I have this in my config.php $config['maxImageResizePixelCount'] = 100000000;

The image dimensions are 72,363,060 and the size is around 95 megabytes. No matter what I do it will always show as an attachment and not inline.
 
I'm getting the same issue now on 2.2, I am testing a new site and one of our members uploaded a 15mb file and it's showing as an attachment instead of inline. I'm guessing it's too big to display inline for some reason so it just doesn't display it?
 
That's a big file !
Is it wise to have one that big load everytime vs just for people who want to see it ?
So I think he was uploading it more of a test, but ideally what i thought would happen is that xenforo would resize it using gd and then the smaller file would show up. I'm assuming i'm not hosting a 15mb file for everyone coming to the thread?
 
Back
Top Bottom