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

HEIF support #11

Open
schmonz opened this issue May 10, 2022 · 1 comment
Open

HEIF support #11

schmonz opened this issue May 10, 2022 · 1 comment

Comments

@schmonz
Copy link
Contributor

schmonz commented May 10, 2022

My photo-sharing workflow used to be as simple as "mount the WebDAV folder and copy some images over". I'd like to get that back.

Apple devices have defaulted to creating HEIC images for a while now. But it seems browsers generally don't ship with HEIC support. What would you suggest users do to publish such images at present -- batch-convert to JPEG before adding to the gallery?

How involved would it be to teach gallery to handle HEIF in some useful way, perhaps by automating this conversion? I see a couple imlib2 plugins that might help. Another option might be to call out to ImageMagick (which can be linked with libheif) to do the conversion.

@schmonz
Copy link
Contributor Author

schmonz commented Apr 8, 2024

If .HEIC files are in a gallery directory, attempts to view the directory thumbnail gives Not a JPEG file in the logs, and attempts to browse the directory contents give 500 internal server error. Not sure which image processing code that string is coming from.

If imlib2 has been built with libheif support (PKG_OPTIONS.imlib2+=heif to us), then the imlib2_conv program can convert .HEIC to .JPG. For instance:

for i in *.HEIC; do
  j=$(basename $i .HEIC)
  imlib2_conv $j.HEIC $j.JPG && rm $j.HEIC
done

If imlib2 has not been built with libheif support, then attempting this conversion gives *** Error -2:'Imlib2: No loader for file format' loading image: and exits 1.

Conversion isn't terribly fast and doesn't offer any choice of parameters. I haven't tried to compare image quality before and after. But it seems like something we could add to gallery without requiring any new dependencies, sort of.

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

No branches or pull requests

1 participant