[Here](https://github.com/link-u/avif-sample-images/blob/master/kimono.rotate90.avif) 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](
https://github.com/strukturag/libheif/blob/33e00a4ec54e6fffca3febe3054017b1b81a0c49/libheif/context.cc#L614): 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.
Wrong image dimensions when irot is set
This is a GitHub Issue
repo:libheif
owner:strukturag
Title : Wrong image dimensions when irot is set
Issue date:

--- start body ---
[Here](https://github.com/link-u/avif-sample-images/blob/master/kimono.rotate90.avif) 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](
https://github.com/strukturag/libheif/blob/33e00a4ec54e6fffca3febe3054017b1b81a0c49/libheif/context.cc#L614): 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.
--- end body ---
