You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempted to open an RLE8-compressed bitmap image.
What did you expect to happen?
The image to display correctly.
What actually happened?
An IOError("Unsupported BMP compression (%d)" % file_info['compression']) was thrown.
We try to open the image in our main program:
try:
image = Image.open(path)
...
This calls the BmpImageFile class from BmpImagePlugin.py, which attempts to display the file according to the compression types listed in the dictionary on line 63:
After reading header data, the program continues; on line 158, an if statement checks:
if file_info['compression'] == self.BITFIELDS:
which evaluates to false. So, the program then jumps to line 190, where it checks whether the file's compression type is RAW:
elif file_info['compression'] == self.RAW:
which also evaluates to false. This causes the program to jump the code block to line 193, where the exception is thrown, and causes our main program to fail.
What did you do?
Attempted to open an RLE8-compressed bitmap image.
What did you expect to happen?
The image to display correctly.
What actually happened?
An IOError("Unsupported BMP compression (%d)" % file_info['compression']) was thrown.
We try to open the image in our main program:
This calls the BmpImageFile class from BmpImagePlugin.py, which attempts to display the file according to the compression types listed in the dictionary on line 63:
After reading header data, the program continues; on line 158, an if statement checks:
which evaluates to false. So, the program then jumps to line 190, where it checks whether the file's compression type is RAW:
which also evaluates to false. This causes the program to jump the code block to line 193, where the exception is thrown, and causes our main program to fail.
The code that ultimately throws this exception is found at line 194, in the BmpImagePlugin source.
What are your OS, Python and Pillow versions?
testImages.zip
The text was updated successfully, but these errors were encountered: