! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
inabblity to show pictures with mismatching file extension vs mime type
Status:
RESOLVED: FIXED
Product:
Ristretto
Component:
Application

Comments

Description Jacob Dahl Pind 2015-03-10 20:48:17 CET
Created attachment 6067 
skip the gdk_pixbuf_loader_new_with_mime_type

Ristretto fails to show pictures where file extension doesnt match the mime type

in ristretto-0.8.0/src/image_viewer.c the following is called

 transaction->loader = gdk_pixbuf_loader_new_with_mime_type (rstto_file_get_content_type (file), NULL); 

it shows an error as the suppled mime type is wrong, glib2s content sniff seems brokken as the file extension gets used.

right after that line we have 

      /* HACK HACK HACK */
     if (transaction->loader == NULL)
     {
          transaction->loader = gdk_pixbuf_loader_new();
     }

Sadly that fails as transaction->loader aint NULL when the error has been show, so we end up with ristretto never showing the picure, eventhough it has showen the thumbnail.

Solution dont call the gdk_pixbuf_loader_new_with_mime_type just go straight to gdk_pixbuf_loader_new_with_mime_type , well easier than trying to fix glib2 anyway.
Comment 1 Igor editbugs 2016-10-07 17:25:19 CEST
*** Bug 12499 has been marked as a duplicate of this bug. ***
Comment 3 Igor editbugs 2017-02-01 12:54:50 CET
Implemented.

Bug #11680

Reported by:
Jacob Dahl Pind
Reported on: 2015-03-10
Last modified on: 2017-02-01
Duplicates (1):
  • 12499 Fatal error reading PNG image file: Not a PNG file

People

CC List:
2 users

Version

Version:
master

Attachments

skip the gdk_pixbuf_loader_new_with_mime_type (537 bytes, application/gzip)
2015-03-10 20:48 CET , Jacob Dahl Pind
no flags

Additional information