Error "Unsupported marker type" when loading JPG files from some cameras
@msanchez
Submitted by Mario Sanchez Prada Link to original bug (#791971)
Description
As reported originally in bug 768639, certain types of files (such as [1], reported as a bug for Vimiv [2]) fail to load when using GdkPixbufLoader
, resulting in errors such as the following ones:
Error interpreting JPEG image file (Unsupported marker type 0xb9)
Error interpreting JPEG image file (Unsupported marker type 0x3e)
Error interpreting JPEG image file (Unsupported marker type 0x1a)
As reported in [3] and [4], it's interesting to note that the very same files load fine when using gdk_pixbuf_new_from_file()
instead of the GdkPixbufLoader
, even though if both code paths end up using the JPEG IO module from gdk-pixbuf.
I've spent some time today debugging this and this looks like a problem in gdk-pixbuf since the problem happens when using gdk_pixbuf_loader_write()
, which relies on the internal gdk_pixbuf__jpeg_image_load_increment()
function to load the data... well... incrementally. However, the problem doesn't happen when using gdk_pixbuf_new_from_file()
, which relies on the internal gdk_pixbuf__jpeg_image_load()
function instead (which is much simpler).
If you check bug 768639 you'll see this bug has been reported a while ago already, and initially I thought this might be a problem in the underlying jpeg library, but the more recent comments/experiments point to gdk-pixbuf, so I'm reporting this since I couldn't figure it out by myself yet, in case someone else can help.
FWIW, this seems to be an increasingly annoying problem since, even though originally I could not reproduce it at all, I can now reproduce it very easily with pictures taken with my wife's Moto G3 and my own OnePlus 5 phones, and who knows what else.