JPEG mismatch
I stumbled upon a strange jpeg here: https://github.com/DeaDBeeF-Player/deadbeef/issues/2667
It turned out that the new MIME type introduced in 3b1a9313 highly confuses gdk-pixbuf, apparently because that jpeg has this "application/x-apple-systemprofiler+xml" XML actually embedded in it, within the relevant offset:
# grep -ab 'plist version' cover.jpg
252:<plist version="1.0">
Here's a quick test app:
#include <gtk/gtk.h>
gint main(gint argc, gchar **argv) {
guchar *filename = argv[1];
GdkPixbufFormat *format;
gint height;
gint width;
format = gdk_pixbuf_get_file_info (filename, &width, &height);
printf ("%s (%s)\n", gdk_pixbuf_format_get_name (format), gdk_pixbuf_format_get_description (format));
printf ("%dx%d pixels\n", width, height);
return 0;
}
and it returns:
./getimageinfo cover.jpg
(process:12003): GdkPixbuf-CRITICAL **: 19:54:08.376: gdk_pixbuf_format_get_description: assertion 'format != NULL' failed
(process:12003): GdkPixbuf-CRITICAL **: 19:54:08.377: gdk_pixbuf_format_get_name: assertion 'format != NULL' failed
(null) ((null))
-1x-1 pixels
But after decreasing the priority from 50 to 49 or lowering the end offset to 200:
./getimageinfo cover.jpg
jpeg (JPEG)
500x500 pixels
I have found a few similar jpegs in my collection, however most of them have the XML embedded after 256th byte and hexdump shows "Photoshop CS2 [or] CS3" strings in them, instead of "Photoshop 3.0" for the affected ones.