After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612809 - gthumb is unable to rotate attached jpeg image
gthumb is unable to rotate attached jpeg image
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.11.x
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2010-03-13 18:41 UTC by Pacho Ramos
Modified: 2010-07-16 15:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pacho Ramos 2010-03-13 18:41:42 UTC
When pressing "[" or "]" to rotate 90 degrees, gthumb fails and reports:
"Could not perform the operation
Error interpreting JPEG image
Bogus virtual array access"

On the other hand, eog work fine with it

I have:
jpeg-8
gthumb-2.11.2.1

Downstream bug report:
http://bugs.gentoo.org/show_bug.cgi?id=309251
Comment 1 Paolo Bacchilega 2010-03-14 10:44:23 UTC
I can rotate it without problems with the current master branch version
Comment 2 Pacho Ramos 2010-03-14 11:12:45 UTC
Is a bump scheduled soon?
Comment 3 Paolo Bacchilega 2010-03-14 22:32:55 UTC
(In reply to comment #2)
> Is a bump scheduled soon?

no
Comment 4 Pacho Ramos 2010-03-15 21:23:42 UTC
It even fails for me with trunk version :-(, maybe it's due our jpeg lib?
Comment 5 Samuli Suominen 2010-03-18 10:29:21 UTC
"Bogus virtual array access" is what you see when using transupp.{c,h} from jpeg-6b in combination with system jpeg-8 or jpeg-8a. 

Here you can see the exactly same problem in KDE's gwenview:

http://bugs.kde.org/show_bug.cgi?id=227313

Solution 1: Make jpeg upstream include transupp.* in their API, so you don't need to bundle them anymore. This is unlikely to happen.

Solution 2: Switch from using bundled source files to calling `jpegtran` binary for lossless rotation.

Solution 3: Update the bundled files from jpeg-8a source tree, this will break backwards compability with jpeg-6b.
Comment 6 Paolo Bacchilega 2010-03-18 10:47:38 UTC
(In reply to comment #5)

I think the better solution is to bundle both versions and conditionally compile the one compatible with the installed jpeg library.
Comment 7 Michael Chudobiak 2010-03-30 12:39:58 UTC
Pacho,

Can you test with the current git version? It should be fixed now.

- Mike
Comment 8 Pacho Ramos 2010-03-30 13:00:52 UTC
It sadly fails to build for me :-(

/bin/sh ../../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../..    -pthread -DORBIT2=1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/unique-1.0    -I../.. -I../../gthumb  -ggdb -Wall -Wcast-align -Wtype-limits -Wclobbered -Wempty-body -Wignored-qualifiers  -MT libjpeg_utils_la-transupp-80.lo -MD -MP -MF .deps/libjpeg_utils_la-transupp-80.Tpo -c -o libjpeg_utils_la-transupp-80.lo `test -f 'transupp-80.c' || echo './'`transupp-80.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -pthread -DORBIT2=1 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/unique-1.0 -I../.. -I../../gthumb -ggdb -Wall -Wcast-align -Wtype-limits -Wclobbered -Wempty-body -Wignored-qualifiers -MT libjpeg_utils_la-transupp-80.lo -MD -MP -MF .deps/libjpeg_utils_la-transupp-80.Tpo -c transupp-80.c  -fPIC -DPIC -o .libs/libjpeg_utils_la-transupp-80.o
In file included from transupp-80.c:47:
/usr/include/jpeglib.h:1148:55: error: jpegint.h: No such file or directory
transupp-80.c: In function 'do_crop':
transupp-80.c:133: warning: implicit declaration of function 'jcopy_block_row'
transupp-80.c: In function 'jtransform_request_workspace':
transupp-80.c:1093: warning: implicit declaration of function 'jdiv_round_up'
make[2]: *** [libjpeg_utils_la-transupp-80.lo] Error 1
make[2]: Leaving directory `/home/pacho/gthumb/extensions/jpeg_utils'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/pacho/gthumb/extensions'
make: *** [install-recursive] Error 1

Thanks for your work :-)
Comment 9 Paolo Bacchilega 2010-03-30 19:28:48 UTC
> /usr/include/jpeglib.h:1148:55: error: jpegint.h: No such file or directory

for some reason you don't have jpegint.h installed, your distribution should include it in the libjpeg-devel package.
Comment 10 Pacho Ramos 2010-03-30 21:05:16 UTC
But, it's present (!?):
$ ls -l /usr/include/jpeglib.h
-rw-r--r-- 1 root root 48475 mar 19 14:07 /usr/include/jpeglib.h

:-/
Comment 11 Paolo Bacchilega 2010-03-31 07:50:52 UTC
jpegint.h, not jpeglib.h
Comment 12 Samuli Suominen 2010-04-05 10:57:10 UTC
No, jpegint.h is jpeg's internal file and shouldn't be installed into system in a -devel package or not.

Correct, to fetch also error codes:

#include <jpeglib.h>
#include <jerror.h>

Incorrect, because it will pull in also jpegint.h:

#define JPEG_INTERNALS
#include <jpeglib.h>
Comment 13 Felix Riemann 2010-04-13 21:04:57 UTC
(In reply to comment #12)
> No, jpegint.h is jpeg's internal file and shouldn't be installed into system in
> a -devel package or not.

JFYI, while porting your fix over to eog I also included jpegint.h into our tree. digiKam apparently had no problem shipping it even for the old libjpeg-6b.
Comment 14 Paolo Bacchilega 2010-04-14 11:56:56 UTC
I've included a copy of jpegint.h in gthumb now, thanks for the hint.
Comment 15 Pacho Ramos 2010-04-16 19:46:33 UTC
The error is now different with 2.11.3:

Error interpreting JPEG image
JPEG datastream contains no image
Comment 16 Robert Schittny 2010-05-05 10:42:03 UTC
(In reply to comment #15)
> The error is now different with 2.11.3:
> 
> Error interpreting JPEG image
> JPEG datastream contains no image

Same here with gthumb-2.11.3 and jpeg-8a.
Comment 17 akusai 2010-05-14 11:55:43 UTC
Same here with 2.11.3. 
The jpeg's are from a Canon Eos 400D and gthumb worked fine until 2.10.11. 
Saving the same image in jpeg-format from within gthumb works, but even those jpegs do not get rotated by gthumb.
Rotating images in other programs like geeqie works fine.
Comment 18 Paolo Bacchilega 2010-05-15 12:20:31 UTC
can someone please test the current master branch version?
Comment 19 michal 2010-05-27 21:57:14 UTC
using jpeg-8a, I still get a dialog which says:

Could not perform the operation

Error interpreting JPEG image

JPEG datastream contains no image
Comment 20 Pacho Ramos 2010-07-14 18:03:11 UTC
Still the same with 2.11.5
Comment 21 Paolo Bacchilega 2010-07-16 15:00:57 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.