Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#15540 - [gtk2] huge problems viewing jpeg images with many programs.

Attached to Project: Arch Linux
Opened by mikes (mechmg93) - Friday, 17 July 2009, 14:18 GMT
Last edited by Jan de Groot (JGC) - Wednesday, 14 October 2009, 06:58 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Jan de Groot (JGC)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No


Name : gqview
Version : 2.0.4-2

I have serious problems viewing jpeg images through gqview. Most of the images look either blurry or with completely wrong colors and sometimes look completely destroyed. It seems that there is another libjpeg7 issue because i have problems only with jpeg files.


This task depends upon

Closed by  Jan de Groot (JGC)
Wednesday, 14 October 2009, 06:58 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 2.18.2.
Comment by Ionut Biru (wonder) - Friday, 17 July 2009, 14:37 GMT
is not a bug in gqview. gtk has a minor problem with the new libjpeg.
Comment by mikes (mechmg93) - Friday, 17 July 2009, 15:12 GMT
so i think it's time to open a bug report for gtk library.
Comment by Börje Holmberg (linfan) - Friday, 17 July 2009, 16:09 GMT
so it is suddenly a minor problem that an app crashes?! IMHO it is a huge problem.
Comment by Gerardo Exequiel Pozzi (djgera) - Friday, 17 July 2009, 17:13 GMT
  • Field changed: Category (Packages: Extra → Upstream Bugs)
gqview is obsolete and replaced by geeqie, anyway geeqie [#1] and other GTK+2 programs fails.

This is already reported to upstream, but probably the problem is in gtk+2.

Comment by Börje Holmberg (linfan) - Friday, 17 July 2009, 18:37 GMT
allow me to doubt the above thesis. My friend has the new gtk2, but has not yet upgraded the jpeg-7 and gqview works perfectly, why I do not bother to upgrade his install. I myself cannot downgrade jpeg to version 6b-6 as I would need to downgrade a bunch of other programs as well.
Comment by Allan McRae (Allan) - Saturday, 18 July 2009, 02:44 GMT
And here is the upstream report: . Looks like it will need community debugged as the developer does not have libjpeg7 on their system.

I also attached a simple pygtk script that loads a jpeg image using gdk-pixbuf. It works fine for me. Is anybody able to make a C version of this? If we can get it down to a minimal example of the issue, it will be much easier to trace to cause.
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 18 July 2009, 06:32 GMT
Like the python version, this don't fail. Need more research what is the function.

   ima.c (0.5 KiB)
Comment by Allan McRae (Allan) - Saturday, 18 July 2009, 06:45 GMT
This comment from Vain explains it:

The blurring only occurs when you use a GdkPixbufLoader.
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 18 July 2009, 07:19 GMT
This seems to fix this problem.
Comment by Börje Holmberg (linfan) - Saturday, 18 July 2009, 07:59 GMT
I only installed gdk-pixbuf after the problems, so it seems that gqview and geeqie is not depending on gdk-pixbuf and work without it. Why I suppose gdk-pixbuf is no fix for gqview and geeqie and has nothing to do with libjpeg7. I still believe libjpeg7 to be the cause of all problems. Either it should be rolled back or fixed.
Comment by Börje Holmberg (linfan) - Saturday, 18 July 2009, 08:08 GMT
A lot of packages have been built against libjpeg7 - here are those I have on this laptop:

pacman -R libjpeg
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: amsn-svn: requires libjpeg
:: compiz-fusion-plugins-main: requires libjpeg>=7
:: gegl: requires libjpeg>=7
:: imlib: requires libjpeg>=7
:: imlib2: requires libjpeg
:: jasper: requires libjpeg>=7
:: libdjvu: requires libjpeg>=7
:: libgphoto2: requires libjpeg>=7
:: libmng: requires libjpeg>=7
:: libtiff: requires libjpeg>=7
:: libwmf: requires libjpeg>=7
:: mjpegtools: requires libjpeg>=7
:: mplayer: requires libjpeg>=7
:: poppler: requires libjpeg>=7
:: sdl_image: requires libjpeg>=7
Comment by Allan McRae (Allan) - Saturday, 18 July 2009, 08:16 GMT
Or we could fix the issue using the patch Gerardo posted right above your comments...
Comment by Henrik Tunedal (putte_xvi) - Friday, 24 July 2009, 03:09 GMT
The blurring problem still occurs when images are scaled to 50 %. See forum post:
Comment by Börje Holmberg (linfan) - Friday, 24 July 2009, 06:48 GMT
Good this bug is reopened :) There is definitely something wrong with libjpeg7. Both gqview and geeqie cannot handle resizing. The fit to window does not work. I run gnome and if I choose open with gqview from my photo album gqview crashes. gqview only works if I start it first and then choose to open a picture. Geeqie works both ways, but it cannot fit images to window. They become sqaure and centered.
Comment by Roman Kyrylych (Romashka) - Friday, 24 July 2009, 07:15 GMT
aren't there any fixes for this in geeqie's development tree?
Comment by Jan de Groot (JGC) - Friday, 24 July 2009, 07:18 GMT
I don't see where this is a bug in gtk2, as eog can scale fine.
Comment by Allan McRae (Allan) - Friday, 24 July 2009, 07:47 GMT
The patch in the bbs thread link is much better than the original one. It _fully_ corrects the scaling in gtk+ using what is specified in the new libjpeg documentation.
Comment by Henrik Tunedal (putte_xvi) - Friday, 24 July 2009, 14:56 GMT
To see that this is a bug in gtk2, try the attached test case (a modified version of the one electropura posted in the forum).

It will load an image at 100, 50 and 25 % and gives the following results for me:
Unpatched GTK: 100 blurry, 50 OK, 25 OK
GTK from repo: 100 OK, 50 blurry, 25 blurry (now that I look closely; a bit hard to see)
My patch: all OK.

You can also try inserting images scaled to 50 % in Zim. With gtk2 2.16.5-1 they are blurry, which is what led me to look into this.
Comment by David Keogh (muramasa) - Monday, 14 September 2009, 03:49 GMT
Are there any plans for apply the patch above? Or is the maintainer waiting for a fix upstream?
Comment by Allan McRae (Allan) - Thursday, 08 October 2009, 06:57 GMT
This is from the current upstream maintainer of libjpeg:

I strongly advise to correct the code by simply inserting the statement

cinfo->scale_num = 1;

in front of the following code sequence in mentioned function:

for (cinfo->scale_denom = 2; cinfo->scale_denom <= 8; cinfo->scale_denom *= 2) {
jpeg_calc_output_dimensions (cinfo);

This addition will work with older and newer versions of the library.