Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st_data_plotter .py PIL.Image.DecompressionBombError #47

Open
lili03080317 opened this issue Jul 19, 2023 · 1 comment
Open

st_data_plotter .py PIL.Image.DecompressionBombError #47

lili03080317 opened this issue Jul 19, 2023 · 1 comment

Comments

@lili03080317
Copy link

Hi,
When I run python st_data_plotter.py --counts-table-files stdata.tsv --image-files ST_rep1.jpg --outdir /root/home/ --show-genes CASP7�,I got a error like this.

Total number of spots 1933
Total number of genes 17138
Number of expressed genes a spot must have to be kept (0.01% of total expressed genes) 193
Dropped 19 spots
Removing genes that are expressed in less than 19 spots with a count of at least 1
Dropped 4804 genes
Computing per spot normalization...
Plotting data...
Traceback (most recent call last):
File "st_data_plotter.py", line 214, in
args.use_log_scale)
File "st_data_plotter.py", line 156, in main
vmax=vmax)
File "/opt/miniconda3/envs/scgpt/lib/python3.7/site-packages/stanalysis-0.5.1-py3.7.egg/stanalysis/visualization.py", line 187, in scatter_plot
img = plt.imread(image)
File "/opt/miniconda3/envs/scgpt/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2158, in imread
return matplotlib.image.imread(fname, format)
File "/opt/miniconda3/envs/scgpt/lib/python3.7/site-packages/matplotlib/image.py", line 1560, in imread
with img_open(fname) as image:
File "/opt/miniconda3/envs/scgpt/lib/python3.7/site-packages/PIL/Image.py", line 3277, in open
im = _open_core(fp, filename, prefix, formats)
File "/opt/miniconda3/envs/scgpt/lib/python3.7/site-packages/PIL/Image.py", line 3264, in _open_core
_decompression_bomb_check(im.size)
File "/opt/miniconda3/envs/scgpt/lib/python3.7/site-packages/PIL/Image.py", line 3173, in _decompression_bomb_check
raise DecompressionBombError(msg)
PIL.Image.DecompressionBombError: Image size (251920384 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.

How to fix it?Thank you.

@jfnavarro
Copy link
Owner

This is a known issue related to the image size limit in matplotlib. There are multiple work-arounds for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants