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

iOS HEIC images don't work #208

Open
phette23 opened this issue Jul 25, 2024 · 0 comments
Open

iOS HEIC images don't work #208

phette23 opened this issue Jul 25, 2024 · 0 comments

Comments

@phette23
Copy link

Package version (if known): 2.2.1 and all prior

Describe the bug

Apple's iOS devices save HEIC images with misleading .jpg extensions which tricks previewer into thinking that it can preview them but (almost all) web browsers cannot render these images.

Steps to Reproduce

  1. Create a record with all required fields
  2. Attach a HEIC image with a .jpeg extension
  3. Publish the record

Expected behavior

HEIC images should be skipped, treated like other image formats that are not previewed, such as WebP. Instead, previewer thinks it can use the simple_image previewer, but the image does not render in the img tag because browser rendering engines cannot display HEIC.

Screenshots (if applicable)

invenio previewer heic error

Additional context

I think the solution would involve using some kind of file type detection library (filetype, puremagic) which looks at the bytes of the image file to determine whether they can be previewed instead of relying upon their extension. This would have a bonus effect of fixing previews of files with misleading extensions (e.g. plain text file with .png extension).

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