Debian Bug report logs - #669562
libgdk-pixbuf2.0-0: fails to load some image files due to wrong detected mime type

version graph

Package: src:gdk-pixbuf; Maintainer for src:gdk-pixbuf is Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>;

Reported by: Alexis Bienvenüe <pado@passoire.fr>

Date: Thu, 19 Apr 2012 20:33:02 UTC

Severity: normal

Found in version gdk-pixbuf/2.26.1-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>:
Bug#669562; Package libgdk-pixbuf2.0-0. (Thu, 19 Apr 2012 20:33:05 GMT) (full text, mbox, link).


Acknowledgement sent to Alexis Bienvenüe <pado@passoire.fr>:
New Bug report received and forwarded. Copy sent to Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>. (Thu, 19 Apr 2012 20:33:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Alexis Bienvenüe <pado@passoire.fr>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libgdk-pixbuf2.0-0: fails to load some image files due to wrong detected mime type
Date: Thu, 19 Apr 2012 22:13:12 +0200
Package: libgdk-pixbuf2.0-0
Version: 2.26.1-1
Severity: normal

Dear Maintainer,

It appears that some PNG files I used couldn't be load by gdk_pixbuf_new_from_file,
because their mimetype was detected to be application/x-designer by g_content_type_guess,
although the mimetype command returns image/png for these files.

These files can be viewed without problem with for example eog or gimp, but can't be viewed
with geeqie.

The C program below returns

Mime: application/x-designer
test file load failure, error message: Couldn't recognize the image file format for file '2-7.png'

The file 2-7.png is a proper PNG file but has a content that matches the magic conditions
for application/x-designer in the /usr/share/mime/magic used by g_content_type_guess.

Perhaps a solution to solve the problem would be to let GDK_PIXBUF_USE_GIO_MIME undefined
(using gio_can_sniff=no in configure options?), but I don't know if this has drawbacks.

Thanks,
AB.

-- PNG file can be found at

http://docs.passoire.fr/alexis/perso/2-7.png

-- C code (compiled by gcc -o test test.c `pkg-config --cflags --libs gtk+-2.0`)

#define TEST_FILE "2-7.png"

#define SNIFF_BUFFER_SIZE 4096

#include<gtk/gtk.h>
#include <glib.h>
#include <gio/gio.h>

int main ( int argc, char *argv[] ) {
  gtk_init (&argc, &argv);

  GdkPixbuf *test = NULL; 
  GError *gerror=NULL ; 

  gboolean uncertain;
  gchar *mime_type;
  FILE *f;
  int size;

  guchar buffer[SNIFF_BUFFER_SIZE];

  f = g_fopen (TEST_FILE, "rb");
  size = fread (&buffer, 1, sizeof (buffer), f);
  fclose (f);
  mime_type = g_content_type_guess (NULL, buffer, size, &uncertain);

  printf("Mime: %s\n",mime_type);
  if(uncertain) printf("(uncertain)\n");
  
  test = gdk_pixbuf_new_from_file(TEST_FILE,&gerror);
  if(!test) {
    printf("test file load failure, error message: %s\n",
         gerror->message);
  } 
}

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (1001, 'testing'), (60, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/3 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libgdk-pixbuf2.0-0 depends on:
ii  libc6                    2.13-27
ii  libgdk-pixbuf2.0-common  2.26.1-1
ii  libglib2.0-0             2.32.0-4
ii  libjasper1               1.900.1-13
ii  libjpeg8                 8d-1
ii  libpng12-0               1.2.49-1
ii  libtiff4                 3.9.6-2
ii  libx11-6                 2:1.4.4-4
ii  multiarch-support        2.13-27

libgdk-pixbuf2.0-0 recommends no packages.

libgdk-pixbuf2.0-0 suggests no packages.

-- no debconf information




Bug reassigned from package 'libgdk-pixbuf2.0-0' to 'src:gdk-pixbuf'. Request was from Simon McVittie <smcv@debian.org> to control@bugs.debian.org. (Sun, 06 Dec 2020 13:06:15 GMT) (full text, mbox, link).


No longer marked as found in versions gdk-pixbuf/2.26.1-1. Request was from Simon McVittie <smcv@debian.org> to control@bugs.debian.org. (Sun, 06 Dec 2020 13:06:16 GMT) (full text, mbox, link).


Marked as found in versions gdk-pixbuf/2.26.1-1. Request was from Simon McVittie <smcv@debian.org> to control@bugs.debian.org. (Sun, 06 Dec 2020 13:06:16 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jan 23 19:32:04 2026; Machine Name: berlioz

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.