Skip to content

Conversation

@Eta0
Copy link

@Eta0 Eta0 commented Nov 23, 2025

AVIF Orientation Detection

Resolves #264.

This change adds orientation-detecting code for the AVIF decoder based on imir and irot tags, allowing for orientation normalization.

These images can be used to test the implementation, as they contain every combination of imir and irot tags. All of them now look correct after transcoding.

Sidenote: NormalizeOrientation

As a sidenote, from what I can tell, the NormalizeOrientation flag for an ImageOptions object doesn't actually do anything. It's never checked anywhere, and the normalizeOrientation() function is actually called unconditionally in the below-listed section of the code, so it's effectively always treated as true.

lilliput/ops.go

Line 329 in 686cbce

o.normalizeOrientation(inputHeader.Orientation())

I didn't fix that here because there is no decent fallback at the moment to use when it is false (like preserving orientation metadata instead), but I figured I'd give y'all a heads-up about it anyway in case you want to make it do something.

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

Successfully merging this pull request may close these issues.

AVIF Images Embedding With Incorrect Rotation

1 participant