XF 2.0 IE11 cannot display thumbnail attachments in posts

Sysnative

Well-known member
IE11 is unable to display attachment thumbnails in posts, instead displaying the alt image text:

1534069900477.webp

Instead of the correctly loading:

1534069928120.webp
 
Last edited:
Reviewing - this seems to work okay on xenforo.com.

Possibly because our attachments are saved outside of /public_html/ so IE10 can't access? It works fine for all other browsers but can't replicate on xenforo.com...
 
Possibly because our attachments are saved outside of /public_html/

That would present an issue to other browsers also as it would most likely be a permission/ownership issue or a base_dir issue.
What does the browser console show? It should reflect an error stack trace in it for the image.
 
OK.. have found some relevant Google searches and most have to do with Mime types in the Apache configuration.
Some have been due to the image not really being the type that the extension says it is (a PNG shown as a JPG as an example).
Can you provide a link to the image in question?
The reason I need the actual link is so I can use curl on some tests and don't want to have to manually type what your image reflects. It's easier to cut/paste.
 
I think it's going to have to do with nginx sending this x-content-type-options: nosniff content type option. Try disabling that and see if it displays. If so, the issue is pretty much going to be that the image is not a JPG and IE 11 is detecting that and refusing to display it (MIME issue).
I can't really tell as curl -I is giving me a 401 error (unauthorized) which indicates that direct linking to the image is not allowed or I typed the URL in wrong.
 
It may also have something to do with this, which would give me a 401 error that I'm getting.

Screen Shot 2018-08-12 at 6.30.49 AM.webp

Is there a particular reason you have your /xf/data under htaccess type protection?
This would probably work fine as long as your server IP is in there... but it does present a problem for trying to troubleshoot the image since I can't access it to check the mime type that gets sent.
 
Last edited:
The image is password protected as it's on a dev forum - but here is the IE11 headers for the image itself:
1534073922810.webp

The image loads fine when following the source URL. Not working at all in the posts for IE11.

Could try disabling nosniff on x-content-type-options, but I'd rather resolve the root issue instead of removing a security measure.
 
If you notice, it's shown to be a JPG in the link, but your Mime type (Content-Type) is actually a PNG. This is an IE 11 issue, and removing the nosniff content type header will allow it to work. The only problem with that is it goes against good security procedures. You could change extension of the file and re-upload it to that message as an administrator and then delete the link to the old one. I would NOT rename the file in that directory though as it may be listed in the DB also.
 
Okay - so the image URL that XF is generating in the attachments is as a jpg, but the image is actually a png file.

The image is saved via XF2 so why the difference?
No, the image was uploaded with a JPG extension and it's actually a PNG. This happens frequently when you download images from the internet and then upload them somewhere else. I've had that happen several times in that I downloaded an image, usually with a JPEG extension and it ended up being a PNG.
This will be an issue with any other images that are not MIME type correct and are uploaded with the wrong extension.
 
The image was a screenshot taken with the snipping tool, uploaded directly into the XF2 text editor.

To clarify - there are two separate files, a jpg version and a png version. The PNG version is what's loading on Chrome for the image.

For some reason IE is trying to pull in the jpg version - there is an actual jpg version also saved on the site, it's a smaller thumbnail size image that can be viewed by Chrome, has content type JPG in the headers - this file doesn't load in IE11 at all.

There is also the PNG version which Chrome uses, and if given the link IE11 can load fine as well - the header content type for this is PNG.
 
Just noticed the above jpg/png thing is due to differences in the thumbnail being saved as jpg, and full image saved as png.
That would be normal.... as XF creates the thumbnails. Have you tried re-running the rebuild thumbnails cache process in the ACP?
It still looks like an IE 11 issue. But there may also be a bug in the XF 2 processing.
Also, if user group settings are set so that only registered users can see full size images, guests would get the JPG thumbnail - again, normal behavior.
I'm assuming IE11 is doing this when logged in and not as a guest?
 
Just thought of something else... are you using ImageMagick to do the processing or GD2?
Can you post a link to the actual message? If you restrict guest viewing of full size images don't worry about it. Was going to go grab the Surface Book and see what it does.
 
Top Bottom