Skip to content

imread() function APNG reading problem #27073

@sturkmen72

Description

@sturkmen72

System Information

OpenCV 4.12.0-dev

Detailed description

img = cv.imread("033.png",cv.IMREAD_UNCHANGED) successfully read the APNG image but cv.IMREAD_GRAYSCALE and cv.IMREAD_COLOR fails.

Steps to reproduce

using test image https://github.com/onevcat/APNGKit/blob/master/Tests/APNGKitTests/Resources/SpecTesting/033.png

import cv2 as cv

img = cv.imread("033.png",cv.IMREAD_UNCHANGED)
print(cv.imwrite("033_0.png", img))

img = cv.imread("033.png",cv.IMREAD_GRAYSCALE)
if not img is None:
    print(cv.imwrite("033_0.png", img))

img = cv.imread("033.png",cv.IMREAD_COLOR)
if not img is None:
    print(cv.imwrite("033_0.png", img))

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

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