Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback for PNG QR codes #32

Open
corbindavenport opened this issue Dec 2, 2024 · 2 comments
Open

Fallback for PNG QR codes #32

corbindavenport opened this issue Dec 2, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@corbindavenport
Copy link
Owner

The QR code is currently rendered as a PNG image with no alpha transparency layer, which works well across modern and legacy devices. However, some older browsers support file uploads (the base requirement for ImageShare) but not embedded PNG images, so the QR code doesn't load. Netscape 3.x for Mac is one example I tried.

Internet Explorer didn't support PNG until v4.0 in 1997 on Windows, and v5.0 in 2000 on Mac. Netscape didn't support it until v4.04 in 1997, but I'm not sure if earlier versions support file uploads anyway. This page has more information about PNG support across old web browsers: http://www.libpng.org/pub/png/pngapbr.html

Ideally, ImageShare should provide QR codes in a different format for browsers that don't support PNG. I'm not sure which format would work best (some of them support inline JPEG?). The QR code generation library can only export to PNG or SVG, so another library would need to be used to convert images. I'm also not sure if any kind of feature detection is possible, or if ImageShare would need a list of user agent strings to check and downgrade to another format.

@corbindavenport corbindavenport added the enhancement New feature or request label Dec 2, 2024
@juneyourtech
Copy link

Netscape 3.0 did support file uploads, but I can't vouch for Netscape 2.0 and earlier, owing to having had little experience with these. In its time, Netscape was one of the most fully-featured browsers. The only good competitors feature-wise were Opera, Konqueror, iCab, and Internet Explorer since 4.0.

It's possible to configure non-PNG-supporting browsers through MIME types to open PNG files in an external app that would support that format.

@corbindavenport
Copy link
Owner Author

Yeah, downloading the QR code image is an option. I haven't checked if these old browsers send the Accept HTTP header with a list of supported formats, that would probably be the best detection method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants