Skip to main content

Module orientation

Module orientation 

Source
Expand description

Which way up a picture is, according to its EXIF.

§Why this crate has to own it

iced already applies EXIF orientation — but only on two of its three handle kinds. In iced_graphics-0.14.0/src/image.rs, Handle::Path and Handle::Bytes are decoded with image::open / load_from_memory and then rotated according to exif::Tag::Orientation; Handle::Rgba is a straight passthrough of whatever pixels it is handed.

Those same two paths decode at full resolution with no cap, which is exactly the allocation a viewer cannot afford (see crate::budget). So the viewer must hand over Handle::Rgba — and the moment it does, it inherits the orientation job iced had been doing for it.

Half of that is a bug people see immediately: every portrait phone photograph sideways. The other half is worse, because it looks like the first: apply orientation here and hand iced a path handle somewhere else, and that picture is rotated twice.

Enums§

Orientation
How the stored pixels must be transformed to be shown the right way up.