GNOME Bugzilla – Bug 735995
GDK PixbufLoader problem with TIFF files in 32bit mode on x86_64 linux
Last modified: 2015-02-15 10:15:56 UTC
Created attachment 285292 [details] C source file using Pixbufloader I am trying to load TIFF files progressively using PixbufLoader (pixbufloader.c) which works perfectly fine when compiled natively for x86_64 but the same code produces a run time error when compiled for 32bit on x86_64: "TIFF-Bild konnte nicht geladen werden" which roughly translates to "TIFF image could not be loaded". A corresponding, non-progressive version which uses gdk_pixbuf_new_from_file() works fine in both versions (pixbuf.c). The system I am using is an up-to-date Arch Linux with the following kernel: 3.16.1-1-ARCH #1 SMP PREEMPT Thu Aug 14 07:40:19 CEST 2014 x86_64 GNU/Linux The error occured with all TIFF files that I have tested but works with the same files in other file formats such as PNG or JPG. Please find both C source files, a simple Makefile, three test images in TIFF, JPG, and PNG format as well as some console output attached.
Created attachment 285293 [details] C source file using gdk_pixbuf_new_from_file()
Created attachment 285294 [details] Makefile to create 64bit and 32bit executables
Created attachment 285295 [details] Some console output showing the problem..
Created attachment 285296 [details] Some console output showing the problem..
Created attachment 285297 [details] Makefile to create 64bit and 32bit executables
Created attachment 285298 [details] TIFF image that produces an error when loaded with 32bit PixbufLoader on x86_64
Created attachment 285299 [details] Corresponding JPG that works in all modes
Created attachment 285300 [details] Corresponding PNG that works in all modes
After further debugging, I found out that the bug is coming from libtiff. Macro SeekOK in tiffiop.h does not work as expected in the given configuration: #define SeekOK(tif, off) \ (TIFFSeekFile((tif),(off),SEEK_SET)==(off)) #endif Although the value returned from TIFFSeekFile looks similar to what is provided in off, the macro returns false on my system when running pixbufloader32. If I replace the call to the macro in function TIFFReadRawStrip1 in tif_read.c with the replacement code, pixbufloader32 works as expected.