-
Notifications
You must be signed in to change notification settings - Fork 13
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
read.image failing for very large images #7
Comments
Thanks for reporting this and for looking into it! I'm not entirely sure though whether the problem lies in the code of my package. In principle, for a single JPEG file the |
It seems that indeed there is a problem with the original .jpeg file. After converting it to TIFF with the ImageMagick convert tool I was able to successfully run the example posted at Stack Overflow. |
Interesting, you're right. That jpg was created with ImageMagick though, so I was curious. I converted it to tif as suggested, and it works. Convert it back to jpg again as a new file, and we get the same error again. Could it be a problem only with jpg format? |
Not with JPEG in general, as for example, the following works just fine. filename <- system.file("img", "Rlogo.jpg", package="jpeg")
coreMetadata(read.metadata(filename))$series
## [1] 1 |
Sorry, I still mean for very large pixel sizes, but perhaps only when that (very large) image is jpg? |
Hi, chiming in late but I would to cross-reference this issue with the one reported upstream. Shortly, there is a known limitation/bug during the initialization of very large JPEG files. Although the description does not include the full stack trace, it sounds like a similar issue. |
For images with large pixel counts (eg: 8E8 pixels),
read.image
returns an error, even when trying to return a small subset of the image area.img <- RBioFormats::read.image(filename, subset = list(X=10000:10200, Y=20000:20100))
Seems to be a limitation of the integer class itself, which maxes out at less than 3E8. Changing "I" classes to "J" throughout
read.image.R
doesn't help though.The text was updated successfully, but these errors were encountered: