Skip to content

Orientation field not found after load image and save #1371

Description

@fospring

This happens in open a image

Expected

Image's Orientation information can be reserved

Actual behaviour

What did happen
But image's Orientation information was discard, and image rotated 180 degrees.

Reproduction steps

extern crate image;
use image::GenericImageView;
fn main() {
    let img = image::open("/tmp/images/origin176.jpeg").unwrap();
    img.save("/tmp/images/176.jpeg").unwrap();
}

the origin image info:

➜  images exiftool origin176.jpeg
ExifTool Version Number         : 12.00
File Name                       : origin176.jpeg
Directory                       : .
File Size                       : 6.3 MB
File Modification Date/Time     : 2020:11:18 16:20:20+08:00
File Access Date/Time           : 2020:11:18 16:21:16+08:00
File Inode Change Date/Time     : 2020:11:18 16:24:07+08:00
File Permissions                : rw-------
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Orientation                     : Rotate 180

The origin image has Orientation field

output image info:

➜  images exiftool 176.jpeg
ExifTool Version Number         : 12.00
File Name                       : 176.jpeg
Directory                       : .
File Size                       : 1496 kB
File Modification Date/Time     : 2020:11:18 16:24:41+08:00
File Access Date/Time           : 2020:11:18 16:26:18+08:00
File Inode Change Date/Time     : 2020:11:18 16:24:41+08:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg

And the output image info don't have Orientation field so my image was rotated 180 degree

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions