Skip to content

win10 abort while RGBA with jpg suffix #1554

@GuoQuanhao

Description

@GuoQuanhao

Provide environment information

I have a JPG-suffixed image in RGBA format, which caused errors in my annotations. I believe such naming mismatches are not uncommon. Instead of distinguishing between JPG and PNG based on file extensions, we should rely on PIL (Python Imaging Library) to detect the actual format.

if image_pil.mode == "RGBA":
    image_format = "PNG"
else:
    image_format = "JPEG"

Image

What OS are you using?

win10

Describe the Bug

I have a JPG-suffixed image in RGBA format, which caused errors in my annotations. I believe such naming mismatches are not uncommon. Instead of distinguishing between JPG and PNG based on file extensions, we should rely on PIL (Python Imaging Library) to detect the actual format.

Expected Behavior

No response

To Reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions