Skip to content

Conversion of PIL Image to NumPy fails when image has zero size #5992

@vadimkantorov

Description

@vadimkantorov
from PIL import Image
import numpy as np

a = np.empty((496, 0), dtype=np.uint8)
b = Image.fromarray(a) # succeeds
c = np.asarray(b) # fails with  SystemError: tile cannot extend outside image

PIL version: 8.4.0
NumPy version: 1.21.2

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