Skip to content

OpenCV does not respect exif orientation in PNG file #16579

@codars

Description

@codars
System information (version)
  • OpenCV => 4.2
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2015
Detailed description

PNG format starts to support EXIF information since 2017, but somehow using IMREAD_COLOR to read a PNG file does not respect the orientation

Attached Capture.png and Capture.jpg are two images both with same EXIF orientation information, try both and you can see the difference.

Steps to reproduce
    // C++ code example
    cv::Mat cvImgColor = cv::imread("Capture.png", cv::IMREAD_COLOR);
    // Expected: cols = 333, rows = 280
    // Actual: cols = 280, rows = 333

tempsnip

Capture

Capture

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions