-
Notifications
You must be signed in to change notification settings - Fork 43
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
Image thumbnails/property-draw previews fail with very large images #162
Comments
Can you link to the file? |
(For posterity) |
I believe it is an issue with the number of pixels. I created a test file with a file size of <800KB, smaller than known preview-able files of much smaller resolutions, but with a resolution of 12000 x 21000. This neither previews, not renders a thumbnail correctly. The test image (png) is a single solid colour (an approximation of the default cosmic accent blue) |
And, I'm fairly sure, whatever it is, it is an issue with the total number of pixels required. A file that is 12000 x 14925 will not correctly preview or have an image thumbnail. A file which is 6000 x 14925 will. So, I don't believe it is either the horizontal or vertical resolution individually causing an issue. That total value is somewhere between |
I havent checked the code but image-rs has a this behavior iirc throws a specific error that can be handled, from there it could be punted to something else for decoding, it could be punted to the end of the decode sequence and then attempt to decode it with a higher limit. ffmpeg required 700MiB to decode it to null it may be reasonable to raise the limits somewhat, the below code takes 720M to decode with --release. It may be reasonable to raise the limits, but only if decoding runs sequentially. Im not sure if they are currently in parallel or not, if they are it may be reasonable to punt failed images that reply with a "memory error" to a secondary queue to be processed in sequence after the main queue is finished use image::io::Reader as ImageReader;
fn main() {
let mut img = ImageReader::open(r"/tmp/test/test.png")
.expect("File Error");
img.no_limits();
img.decode().expect("error");
} |
While attempting to open an PNG of a package dependency tree, I found that the preview functionality of the properties tab failed with very large images, as did the picture thumbnail.
The file in question is a 25 MB (~12000 x ~21000 pixel) image. I'm uncertain of what point the preview fails at, and whether it is an issue of raw file-size, or of the pixel-area.
The text was updated successfully, but these errors were encountered: