Image show fails in Firefox with high resolution image
Open
Nobody has claimed this yet.
bug
P3
- Dominant language
- Python
- Stars
- 18.8k
- Forks
- 2.8k
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 21
Description
This large 10709x2425 image fails to show with
px.imshow or with add_layout_image on Firefox. It does load on Chrome.
from urllib.request import urlretrieve
import plotly.express as px
import PIL.Image
image_url = "https://github.com/plotly/plotly.py/assets/86078178/11c9876a-233c-4a2b-bfd8-5d8f197ca808"
image_file = urlretrieve(image_url)[0]
with PIL.Image.open(image_file) as image:
px.imshow(image).show()
downsampled_image = image.resize((image.width // 4, image.height // 4))
px.imshow(downsampled_image).show()
This code should display a blank plot, followed by a plot of the desired image.
Versions:
plotly: 5.15.0
kaleido: 0.2.1
firefox: 114.0.2 (64-bit)
system: Ubuntu 20.04.6 LTS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Python reproducer using px.imshow and add_layout_image, comparing Firefox with Chrome for the 10709x2425 image and its downsampled version. Trace the image-rendering path used by those entry points and verify the fix by confirming that the full-resolution image displays in Firefox without breaking the downsampled case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100