strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.7k stars 298 forks source link

support of 200MPx files from s24 ultra #1259

Closed ekitru closed 1 month ago

ekitru commented 1 month ago

I have an issue with viewing large HEIC files from my phone s24 ultra.

50 MPx filex are showing, not so fast as jpeg, but it works fine, 200 MPx files cause blinking eog and broken UI, program can be closed only by killing process (xkill or kill -9 pid)

I have added 3 files in 12 50 200 MPx and eog screenshot. https://www.dropbox.com/scl/fo/e9mp4wb2akr578da8zyuu/ADT2ieu-DThdStTtCfSRIdc?rlkey=dsmru7cs6y3lbeduqsspqk9lp&dl=0

list of installled libraries:

apt list | grep heif
heif-gdk-pixbuf/noble,now 1.17.6-1ubuntu4 amd64 [installed] heif-gdk-pixbuf/noble 1.17.6-1ubuntu4 i386 heif-thumbnailer/noble,now 1.17.6-1ubuntu4 amd64 [installed] heif-thumbnailer/noble 1.17.6-1ubuntu4 i386 kodi-imagedecoder-heif/noble 20.1.0+ds1-3build1 amd64 libheif-dev/noble 1.17.6-1ubuntu4 amd64 libheif-dev/noble 1.17.6-1ubuntu4 i386 libheif-examples/noble,now 1.17.6-1ubuntu4 amd64 [installed] libheif-examples/noble 1.17.6-1ubuntu4 i386 libheif-plugin-aomdec/noble,now 1.17.6-1ubuntu4 amd64 [installed,automatic] libheif-plugin-aomdec/noble 1.17.6-1ubuntu4 i386 libheif-plugin-aomenc/noble,now 1.17.6-1ubuntu4 amd64 [installed] libheif-plugin-aomenc/noble 1.17.6-1ubuntu4 i386 libheif-plugin-dav1d/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-dav1d/noble 1.17.6-1ubuntu4 i386 libheif-plugin-ffmpegdec/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-ffmpegdec/noble 1.17.6-1ubuntu4 i386 libheif-plugin-j2kdec/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-j2kdec/noble 1.17.6-1ubuntu4 i386 libheif-plugin-j2kenc/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-j2kenc/noble 1.17.6-1ubuntu4 i386 libheif-plugin-jpegdec/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-jpegdec/noble 1.17.6-1ubuntu4 i386 libheif-plugin-jpegenc/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-jpegenc/noble 1.17.6-1ubuntu4 i386 libheif-plugin-libde265/noble,now 1.17.6-1ubuntu4 amd64 [installed,automatic] libheif-plugin-libde265/noble 1.17.6-1ubuntu4 i386 libheif-plugin-rav1e/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-svtenc/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-svtenc/noble 1.17.6-1ubuntu4 i386 libheif-plugin-x265/noble 1.17.6-1ubuntu4 amd64 libheif-plugin-x265/noble 1.17.6-1ubuntu4 i386 libheif1/noble,now 1.17.6-1ubuntu4 amd64 [installed] libheif1/noble 1.17.6-1ubuntu4 i386 librust-libheif-rs-dev/noble 0.20.0-5 amd64 librust-libheif-sys-dev/noble 1.16.2-5 amd64

I also tried gThumb and have same issue, looks like problem not directly related to HEIC format, but to too huge file resolution.

my machine

Ubuntu 24.04 LTS x86_64 6.9.12-060912-generic GNOME 46.0 Metacity

heif.zip

farindk commented 1 month ago

The decoding in libheif works fine. I can also use heif-dec to convert to JPEG. The problem is in eog or gThumb that cannot handle those large image sizes. Also the converted large JPEG does not work. On the other hand, your image loads fine in gimp (which also uses libheif to load the file).

BTW: I am currently working on better support for large images (much larger than your example). I have images with 65536 MP(!). Those do not even fit into memory, but libheif will support to load them in smaller tiles. But the image viewer applications will have to support this.

ekitru commented 1 month ago

thanks you for detail response, should I open ticket to eog and gthumb teams now?

farindk commented 1 month ago

You can do that, but I imagine that it will not be easy to fix.

The new libheif API for tile access is developed in the file-layout branch. Currently, there is heif_image_handle_get_image_tile_id, but that is still experimental and will change.

eog is based on gdk-pixbuf and that does not support tiles, as far as I know.