Open amaurea opened 8 years ago
Same issue in 2017, fedora 25.
Checked with current feh and Imlib2, the files definitely don't load, but also show no corruption?
As for the reason (imlib2/src/lib/image.h
):
/* 32767 is the maximum pixmap dimension and ensures that
* (w * h * sizeof(DATA32)) won't exceed ULONG_MAX */
#define X_MAX_DIM 32767
/* NB! The image dimensions are sometimes used in (dim << 16) like expressions
* so great care must be taken if ever it is attempted to change this
* condition */
#define IMAGE_DIMENSIONS_OK(w, h) \
( ((w) > 0) && ((h) > 0) && ((w) <= X_MAX_DIM) && ((h) <= X_MAX_DIM) )
That'd be a quite an involved change in Imlib2 to adjust these limits.
Since the library simply refuses to load the images, perhaps at least the error code could indicate that the file exceeded supported dimensions. Again would require some more changes in Imlib2.
Best way is probably to update feh's manpage about this limitation.
How to reproduce:
Expected behavior: Feh displays a uniformly red image. Actual result: A corrupted window with white garbage on a black background. Error messages from the relevant image library are displayed in the terminal. For example, for png images, I see the following:
Scrolling the image replaces the garbage with uniform white while producing more error messages.
While the error messages make it seem like a problem with e.g. libpng, very similar things happen with all the other image formats I've tried. For example:
results in the error message
In this case feh doesn't even open a window to display the file. The same thing happens with gif.
I think this is a regression in feh - I think I could open images like this a year ago.