Filing issue to document email thread with @farindk.

ImageMagick is rejecting some prototype files that I have been creating with the following error:
identify: Invalid input: Unspecified: Too many auxiliary image references (2.0) `file_with_shared_alpha.heic' @ error/heic.c/IsHEIFSuccess/142.

The error is coming from libheif rather than ImageMagick itself. The file in question has two main images (in an 'altr' group) that share an alpha auxiliary image. To me this should be perfectly valid and makes a lot of sense once you start creating files containing 'altr' groups, but I can see why this would be unexpected for simpler files.

The conclusion from the thread is that there is nothing in the spec that explicitly forbids sharing the same auxiliary image between multiple main images and that the restriction in libheif should probably be relaxed. ISOBMFF says that all irefs of a specific type from a source item should be collected into a single ItemReferenceBox, so having multiple irefs is not really an option.
[file_with_shared_alpha.heic.zip](https://github.com/strukturag/libheif/files/14641161/file_with_shared_alpha.heic.zip)

Files with shared auxiliary images fail to parse
This is a GitHub Issue
repo:libheif
owner:strukturag
Title : Files with shared auxiliary images fail to parse
Issue date:

--- start body ---
Filing issue to document email thread with @farindk.

ImageMagick is rejecting some prototype files that I have been creating with the following error:
identify: Invalid input: Unspecified: Too many auxiliary image references (2.0) `file_with_shared_alpha.heic' @ error/heic.c/IsHEIFSuccess/142.

The error is coming from libheif rather than ImageMagick itself. The file in question has two main images (in an 'altr' group) that share an alpha auxiliary image. To me this should be perfectly valid and makes a lot of sense once you start creating files containing 'altr' groups, but I can see why this would be unexpected for simpler files.

The conclusion from the thread is that there is nothing in the spec that explicitly forbids sharing the same auxiliary image between multiple main images and that the restriction in libheif should probably be relaxed. ISOBMFF says that all irefs of a specific type from a source item should be collected into a single ItemReferenceBox, so having multiple irefs is not really an option.
[file_with_shared_alpha.heic.zip](https://github.com/strukturag/libheif/files/14641161/file_with_shared_alpha.heic.zip)

--- end body ---
