Skip to main content

jpeg_bytes_to_oriented_texture

Function jpeg_bytes_to_oriented_texture 

Source
fn jpeg_bytes_to_oriented_texture(
    bytes: &[u8],
    flip: i32,
    sensor_dims: (u32, u32),
) -> Option<Texture>
Expand description

Decode JPEG bytes to a texture, applying EXIF orientation or libraw flip.

The flip and sensor_dims parameters come from the RAW container (libraw). When the decoded JPEG’s aspect ratio already matches the rotated sensor orientation, the container flip is skipped (the camera pre-rotated the preview). When the JPEG carries its own EXIF orientation > 1, that value is trusted unconditionally.