luspi / photoqt

PhotoQt Image Viewer (mirror repo) - https://photoqt.org
GNU General Public License v2.0
51 stars 12 forks source link

Photoqt can't open some large PNGs #31

Closed fccfc5d245c closed 2 months ago

fccfc5d245c commented 3 months ago

Expected Behavior

Display the image when I open it in the usual ways

Current Behavior

The loading animation appears very briefly and then nothing is displayed, but the program still works

Steps to Reproduce

Launch the image from the file explorer or navigate to it from Phtoqt's ui

Context (Environment)

Example Image

The file I was going to use as an example is 30Mb and I can't upload it here, but I'd be happy to send it in any other way, or paste the metadata or any other info the dev thinks is relevant. I could share a Wetransfer link to some images.

Comments

In any case, this isn't a big problem for me, but I'd be happy to help if you want to hunt this bug :)

luspi commented 3 months ago

Thanks for letting me know! If you could share a link to some sample images, that'd be fantastic!

luspi commented 3 months ago

One more question: After the image is "loaded" is nothing displayed or a black rectangle in place of the image? I discovered an issue when the image format (Indexed8 in the case I found) is not natively known to LCMS2 and a color profile is embedded. This resulted in a black rectangle being loaded instead of the image. I improved the handling of such cases with 1ae68664763d782cdc16b555255d4f26a5d063df.

fccfc5d245c commented 3 months ago

There isn't a black rectangle, the background remains translucent as if nothing has been loaded. I'll include a screenshot of the UI too and send you a link to Wetransfer, if that's alright with you. But it's going to have to be tomorrow, it's getting late here. Sorry for not noticing your response earlier!

fccfc5d245c commented 2 months ago

This Mega folder should work: https://mega.nz/folder/zmh3gQaZ#9-zdiVK8nz9A3U_e8C3Wlg

I hope this helps!

luspi commented 2 months ago

Fantastic, thanks! I fixed this issue with 82165069c7e35053b943ba4aea087daed2718712.

Those images are stored in the RGBA64 format with an embedded color profile. PhotoQt uses LittleCMS to apply such color profiles, and it appears that LittleCMS has an issue outputting an image in the RGBA64 format. I simply force it now to use a working image format instead.

fccfc5d245c commented 2 months ago

Great, keep up the good work!