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

Images don't open in Safari #46

Open
rphlo opened this issue May 1, 2024 · 10 comments
Open

Images don't open in Safari #46

rphlo opened this issue May 1, 2024 · 10 comments
Labels
help wanted Extra attention is needed

Comments

@rphlo
Copy link
Contributor

rphlo commented May 1, 2024

I tested this package to dynamically serve jxl from my server, however the images do not open in ios safari or mac safari which are supporting jxl by default.

@Isotr0py
Copy link
Owner

Isotr0py commented May 1, 2024

Emmm, I don't have an iphone/macbook to test this on safari, so I'm not sure if it would be an issue of safari instead.

The jxl image that I encoded using the plugin is able to be opened in Firefox Nightly and displayed normally:
QQ截图20240501194905

Can you provide me some failed jxl image so that I can investigate this further?

@rphlo
Copy link
Contributor Author

rphlo commented May 1, 2024

I investigated further and the issue seems to be with images having a transparency layer.
The images I tested with a transparency layer do not open in firefox nightly while the one without transparency (from JPEG) convert and open properly.

I used the following code:

import pillow_jxl
from PIL import Image

# Lossless encode a png image
with Image.open("example.png") as img:
    img.save("example-lossless.jxl", lossless=True)

# encode image with JPEG-Style quality
with Image.open("example.png") as img:
    img.save("example-lossy.jxl", quality=40)

Here the images:
example.zip

@Isotr0py
Copy link
Owner

Isotr0py commented May 2, 2024

However, all example images can be opened in Firefox Nightly 127.0a1 (2024-05-01) (64-bit):
QQ截图20240502112433

I guess this is a decoder issue about the browser instead...

@rphlo
Copy link
Contributor Author

rphlo commented May 2, 2024

Yes, seems to works with windows firefox, but no success on macos or linux

@ajslater
Copy link

All the images in this thread display on my iPhone in the iOS GitHub app as well as in mobile safari.

@rphlo
Copy link
Contributor Author

rphlo commented Jul 24, 2024

@ajslater you should as Github re-encode all pictures in posts as png.
What about the images in the example.zip file of my previous message?

@ajslater
Copy link

ajslater commented Jul 24, 2024

Woops, my bad. I just tried with desktop safari on the zipped images and while they do show as "JPEG XL Container" to the file utility, they do not open with desktop Mac Safari or the Preivew app. And indeed using this plugin to covert the enclosed png produces a similarly undisplayable jxl.

@Isotr0py Isotr0py added the help wanted Extra attention is needed label Aug 9, 2024
@rphlo
Copy link
Contributor Author

rphlo commented Sep 4, 2024

As I commented in my PR #61 the Exif metadata seems to be the problem, I modified the code to be able to generate file that open on Apple OSs.

@rphlo
Copy link
Contributor Author

rphlo commented Sep 4, 2024

Any release scheduled?

@Isotr0py
Copy link
Owner

Isotr0py commented Sep 4, 2024

The new release has been uploaded to pypi :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants