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

Jpeg XL breaks things pretty badly. #1073

Closed
cooperaj opened this issue Jan 22, 2024 · 6 comments
Closed

Jpeg XL breaks things pretty badly. #1073

cooperaj opened this issue Jan 22, 2024 · 6 comments
Labels
bug Something isn't working fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version reproducible-android Issue is reproducible on Android

Comments

@cooperaj
Copy link

Description
JPEG XL (JXL) images cause Thunder to break output. They're not technically supported by Pictrs so are not used often.

How to Reproduce
Steps to reproduce the behavior:

  1. Go to https://lemmy.world/post/11021604
  2. Screen briefly loads then changes to an empty black screen

Expected Behavior
Even if the image fails the comment thread should still be visible.

Device & App Version:

  • Device: Pixel 6 Pro
  • OS: Android 14
  • App Version: 0.2.9-1
@cooperaj cooperaj added the bug Something isn't working label Jan 22, 2024
@micahmo
Copy link
Member

micahmo commented Jan 22, 2024

I wonder if we'd need to open an issue with Extended Image.

@hjiangsu
Copy link
Member

Interesting - it looks like it renders properly on iOS (which coincidentally relates to the meme 😆)

IMG_1575

@hjiangsu hjiangsu added the reproducible-android Issue is reproducible on Android label Jan 22, 2024
@hjiangsu
Copy link
Member

@micahmo are you able to get the specific error that occurs when trying to load a jpeg xl image?

@micahmo
Copy link
Member

micahmo commented Jan 22, 2024

I'm not sure if it helps, but an exception is thrown here.

image

And here is the call stack.

image

And although it's not in the stack, I assume this comes back to an ExtendedImage.network constructor.

@hjiangsu
Copy link
Member

hjiangsu commented Jan 23, 2024

So I took a deeper look into this, and it seems like this may be out of scope to support jxl at this moment. Flutter itself does not support jxl as mentioned here: flutter/flutter#113476. Flutter does provide fallback to using the OS's media codecs so it depends on the OS. For example, Apple currently has support for jxl but Android still has an open issue for this: https://issuetracker.google.com/issues/259900694?pli=1

It seems like the only solutions here are to either create a jxl codec plugin, or have some resolution on Android's end to implement support for jxl.

What we can do, is add in a check to see if its jxl, and either fallback to showing an error, or request the image in a different format using ?format= for the pictrs endpoint (e.g., ?format=png or ?format=jpeg.

@hjiangsu
Copy link
Member

Just a quick update on this, I've fixed the issue where the comment section breaks when attempting to load a failed image. This handles the more generic case where unsupported formats should fallback gracefully.

In terms of providing support for jxl, that may come in the future. The problem with my suggestion previously is that not all images may come from pictrs, so some additional thought will be needed to come up with a more robust solution.

That being said, since pictrs does not technically support jxl, I dont believe there will be too many instances of this happening so we can revisit jxl support in the future (and maybe then, it'll be more widely adopted!)

@hjiangsu hjiangsu added in-progress Indicates that an issue is currently being worked on fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version and removed in-progress Indicates that an issue is currently being worked on labels Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in upcoming release Indicates that an issue has been fixed, and will be released in the next version reproducible-android Issue is reproducible on Android
Projects
None yet
Development

No branches or pull requests

3 participants