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
This happens in open a image
Expected
Image's
Orientationinformation can be reservedActual behaviour
What did happen
But image's Orientation information was discard, and image rotated 180 degrees.
Reproduction steps
the origin image info:
The origin image has
Orientationfieldoutput image info:
And the output image info don't have
Orientationfield so my image was rotated 180 degree