Open fgraffitti-cyberhawk opened 6 months ago
@fgraffitti-cyberhawk thanks!
The DecompressionBombError
is a safety feature to prevent Denial of Service attacks on a web server. If you are loading an image in fiftyone
, it is probably safe to assume you are loading from a trusted source.
Additionally in metadata computation, we do not read the full image, just the header.
I propose this limit be patched (set then reset to default) to None
within the metadata computation. This is because we wouldn't want to set this value broadly as it seems to be a global setting.
Instructions
Describe the problem
When a dataset contains large images (e.g. 16384x16384 pixels), the metadata for those images don't get populated with the image info (width, heigth, channels etc) when running functions such as
add_coco_labels
,dataset.compute_metadata
etc. See slack thread: https://fiftyone-users.slack.com/archives/C0189A476EQ/p1714051750838069 @swheatonCode to reproduce issue
This is probably due to the use of the function
fo.core.metadata.get_image_info
, that uses the libraryPIL
to read the image. In fact, trying to run this function on one of the large images gives the following error:This can be fixed by changing the
PIL.Image.MAX_IMAGE_PIXELS
default value to a large one (e.g. 1000000000)System information
python --version
): 3.11.7fiftyone --version
): v0.23.8Other info/logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Please do not use screenshots for sharing text. Code snippets should be used instead when providing tracebacks, logs, etc.
Willingness to contribute
The FiftyOne Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the FiftyOne codebase?