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

heic image size reported wrongly #403

Open
grasdk opened this issue Apr 6, 2024 · 2 comments
Open

heic image size reported wrongly #403

grasdk opened this issue Apr 6, 2024 · 2 comments

Comments

@grasdk
Copy link

grasdk commented Apr 6, 2024

Using an specific image with resolution 1600x3232 (definitely not square). image-size v1.1.1 reports the dimensions as 512x512.

Reproduce on WSL in Windows 10:

  • Download the image provided by github user malavolti
  • Install image-size global npm install image-size --global if you haven't already
  • Run image-size 2024-01-28_13.43.14.heic

Result:

$ image-size 2024-01-28_13.43.14.heic
512x512 - 2024-01-28_13.43.14.heic (heic)

This is not unique to the command-line. When using image-size as a node library, the dimensions are also reported to be 512x512.

Here is a screenshot of the image in a tool that shows the dimensions of the image:
image

@netroy
Copy link
Member

netroy commented Apr 8, 2024

I'm not a heic/heif expert, so I don't know if this is an issue in the image or not. but the issue here seems to be that this image contains 2 ispe boxes, while this library assumes that there should only be one such box.

I'm guessing that heic allows storing multiple images, and in this case the first image is a square thumbnail, while the second image is the actual image.

image

@netroy
Copy link
Member

netroy commented Apr 8, 2024

According to this heic does indeed support multiple images. So to fix this issue, we need to figure out which image is the master/primary image, and return dimensions of that.

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

2 participants