Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics

Dashboard
Notifications
Mark all as read
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Browser-Specific Image Problems

+2
−0

There have been some "images don't display in all browsers" problems. This is a test of that. Each image is "Test Image" in magenta/pink letters on a white background.

PNG test image png format

JPG test image jpg format

TIF test image TIF format

BMP test image BMP format


Tested using browserstack.com:

  • Windows 7 & 10 Firefox: TIF does not display
  • Windows 7 & 10 Chrome: TIF does not display
  • Windows 7 & 10 Opera: TIF does not display
  • Windows 7 & 10 IE: BMP does not display
  • Windows 7 & 10 Edge: TIF does not display
  • Mac Safari: No problems!
  • Mac Firefox: TIF does not display
  • Mac Chrome: TIF does not display
  • Mac Opera: TIF does not display
  • Mac Edge: TIF does not display
  • Android (Google Pixel 4) Chrome: TIF does not display
  • Android (Google Pixel 4) Firefox: TIF does not display
  • iOS (iPhone 11) Safari: No problems!
  • iOS (iPhone 11) Chrome: No problems!

This appears to not be a Codidact problem per se:

  • If I try to display the files directly (file://c:/etc. as a URL) in Firefox, the PNG, JPG and BMP all work as expected but TIF ends up as a download.
  • Another (ahem) helpful site has some information about this problem.

So it appears that JPG and PNG are the only truly reliable image formats. Actually, I'm 99+% certain that GIF is also universal, but generally speaking JPG and PNG are preferred to GIF.

Probably no quick & easy solution. Suggestions:

  • Check filetype on upload and only allow if filetype (based on contents, not simply file extension) is PNG, JPG or GIF. This has the advantage of not just blocking marginal image formats but also helping to block malicious Javascript or other nasty stuff.
  • Detect BMP and TIF and offer to convert to JPG or PNG using ImageMagick or a similar system.
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

4 comments

I can see "Test Image" for all 4 image types. Using Edge on Win10. Olin Lathrop‭ 10 months ago

I suspect this is IE/Edge/Windows. TIFF images seem to work there, but not in other environments. ArtOfCode‭ 10 months ago

I can't see the TIFF image. For the others I see "Test image" in magenta/pink letters (not sure if that's what I'm supposed to see - maybe you should say "if you can read these words you can see the image") Andy aka‭ 10 months ago

Additional data point: Waterfox on Linux doesn't show TIFF, but all others. celtschk‭ 3 months ago

1 answer

+4
−0

Completed pending deploy: we'll only allow web-safe image types (PNG, JPEG, GIF). I looked at automatically converting other image types, but it's frustratingly difficult in our current version of Rails - once we upgrade (no timeline on that yet), we might be able to look again.

Why does this post require moderator attention?
You might want to add some details to your flag.

3 comments

Might I suggest also adding webp? It's gaining some significant acceptance and I think is now in all browser but legacy IE. Peter Cooper Jr.‭ 9 months ago

Mozilla Developer Network has a nice article on image types and current browser support; I'd recommend accepting apng, gif, ico, jpeg, png, svg, & webp. Peter Cooper Jr.‭ 9 months ago

@PeterCooperJr.: IIUC the ending of APNG files is PNG, and the file formats are compatible (that is, a program supporting PNG but not APNG will see it as normal PNG image showing the first frame), so APNG should be automatically accepted if PNG is, unless special checks are done that filter them out. celtschk‭ 3 months ago

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!