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

Wrong image dimensions when irot is set #1131

Open
mrjackbo opened this issue Feb 22, 2024 · 5 comments
Open

Wrong image dimensions when irot is set #1131

mrjackbo opened this issue Feb 22, 2024 · 5 comments

Comments

@mrjackbo
Copy link

Here is an image for which libheif 1.17 reports wrong dimensions for the primary image. It has width 722 and height 1024 after the correct rotation is applied, but libheif outputs 1024x722.

$ ./heif-info kimono.rotate90.avif
MIME type: image/avif
main brand: avif
compatible brands: avif, mif1, miaf, MA1B

image: 1024x722 (id=1), primary
  colorspace: YCbCr, 4:4:4
  bit depth: 8
  color profile: no
  alpha channel: no 
  depth channel: no
metadata:
  none
transformations:
  angle (ccw): 270
[...]

I believe the problem is here: For some reason the irot box appears before the ispe box, and thus line 626, which is supposed to flip the dimensions, is never called.

@bradh
Copy link
Contributor

bradh commented Feb 23, 2024

I believe that file is invalid. ISO/IEC 23008-12:2022 Section 6.5.3.1 requires that ispe occurs prior to the association of all other transformative properties. Do you know what software made it?

@emerygrotto
Copy link

@bradh
Copy link
Contributor

bradh commented Feb 23, 2024

The cavif code is abandoned so probably not a priority to work around this bug in the producer.

@silverbacknet
Copy link

silverbacknet commented Feb 23, 2024

Those were generated years ago with an early pre-release of https://github.com/kornelski/cavif-rs . Sometimes early apps just aren't complete, even when someone uses them to purport to be authoritative. (Even samples from standards have suffered from this...)

A misplaced irot is pretty benign, since it can be fixed so easily by restreaming the boxes or just having an app set a new rotation.

@bradh
Copy link
Contributor

bradh commented Feb 23, 2024

Those were generated years ago with an early pre-release of https://github.com/kornelski/cavif-rs . Sometimes early apps just aren't complete, even when someone uses them to purport to be authoritative. (Even samples from standards have suffered from this...)

Interesting. I understood they came from https://github.com/link-u/cavif

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

4 participants