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"

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
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.
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