Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • S shared-mime-info
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xdg
  • shared-mime-info
  • Issues
  • #169
Closed
Open
Issue created Sep 07, 2021 by Jake SFR@jakesfr

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.

Edited Sep 07, 2021 by Jake SFR
Assignee
Assign to
Time tracking