Skip to content

Rotation metadata #515

Open
Open
@the-database

Description

@the-database

Hi, thanks for this project, it is much faster than cv2 for loading small patches from large images for deep learning. I am trying to use it as a drop in replacement for cv2, but I found that the behavior differs from cv2 with respect to PNG images containing rotation metadata. Sample:

import pyvips
import cv2

image_path = r".\0.615461_9766635431_20.png"

im = cv2.imread(image_path)
cv2.imwrite("test_cv2.png", im)

im_vips = pyvips.Image.new_from_file(image_path)
im_vips.write_to_file("test_pyvips.png")

Input file with the rotation metadata: 0.615461_9766635431_20.zip

When I view test_cv2.png in my image viewer, it is in portrait orientation, while test_pyvips.png is rotated 90 degrees clockwise. Am I doing something wrong, or is this behavior a bug with pyvips?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions