1 |
On Fri, Jul 31, 2009 at 8:44 AM, Frank Peters<frank.peters@×××××××.net> wrote: |
2 |
> Since I process a lot of images, libjpeg is very important to me. The new |
3 |
> jpeg-7 now includes arithmetic encoding which can produce smaller compressed |
4 |
> file sizes and there are also some changes to the scaling and quality features. |
5 |
> Unlike most Open Source packages, which are updated quite frequently (too |
6 |
> frequently?), jpeg-7 is the first new release since 1998. |
7 |
> |
8 |
> Rather than wait for Gentoo to create the ebuilds for the new jpeg-7, I decided |
9 |
> to compile it myself and then list it in packages.provided. In addition, |
10 |
> the old jpeg-6 shared objects were kept, but all the include files and |
11 |
> static libraries for linking would refer to the new jpeg-7. In this way, |
12 |
> any update of a package that depends on libjpeg would be linked with the |
13 |
> new libraries, but any existing package that still needs jpeg-6 could be |
14 |
> left untouched. I don't like to have to re-compile everything at once. When |
15 |
> the time comes to update a package the new libraries will be available but until |
16 |
> then the old libraries will suffice. (Gentoo is flexible enough to nicely |
17 |
> accomodate this.) |
18 |
> |
19 |
> However, after emerging a new GTK+, which automatically then became linked |
20 |
> to the new jpeg-7 libraries, I noticed a severe problem. Jpeg images viewed |
21 |
> using programs that depend on GTK+ -- and there are a lot of them -- were |
22 |
> strangely blurred and out of focus. Doing some searching, I found this |
23 |
> thread that explains the problem: |
24 |
> |
25 |
> http://bbs.archlinux.org/viewtopic.php?id=75529 |
26 |
> |
27 |
> The issue is with the new scaling methods in jpeg-7. Programs such as firefox |
28 |
> and many others process images through GTK+ facilities, and GTK+ needs to be |
29 |
> patched before it can utilize the new jpeg-7. AFAIK, the GTK+ people do not |
30 |
> even yet know about this issue. Also, unless I am mistaken, any patch that |
31 |
> accommodates jpeg-7 will no longer function with jpeg-6. |
32 |
> |
33 |
> So there ends my nice, neat plan to have both jpeg-7 and jpeg-6 together |
34 |
> serving my system. The situation also illustrates how unanticipated problems |
35 |
> can easily be injected into this loose but wonderful conglomeration known |
36 |
> as Open Source software. |
37 |
|
38 |
FWIW the newly-released gtk+ 2.16.6 of a coupel days ago still has the |
39 |
problem with jpeg-7, but there was a patch in the gtk bugzilla that |
40 |
fixed the problem for me: |
41 |
|
42 |
Author: Romain Perier <mrpouet@g.o> |
43 |
Subject: Ensure gdk-pixbuf is backward compatible with jpeg6, even if |
44 |
it's works with jpeg7 |
45 |
Date: 2009-09-01 10:27 UTC |
46 |
|
47 |
--- |
48 |
gdk-pixbuf/io-jpeg.c | 5 ++++- |
49 |
1 files changed, 4 insertions(+), 1 deletions(-) |
50 |
|
51 |
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c |
52 |
index cf8c9ed..9af55ba 100644 |
53 |
--- a/gdk-pixbuf/io-jpeg.c |
54 |
+++ b/gdk-pixbuf/io-jpeg.c |
55 |
@@ -921,8 +921,11 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data, |
56 |
return FALSE; |
57 |
} |
58 |
} |
59 |
- |
60 |
+#if JPEG_LIB_VERSION >= 70 |
61 |
+ for (cinfo->scale_denom = 2; |
62 |
cinfo->scale_denom <= 16; cinfo->scale_denom *= 2) { |
63 |
+#else |
64 |
for (cinfo->scale_denom = 2; |
65 |
cinfo->scale_denom <= 8; cinfo->scale_denom *= 2) { |
66 |
+#endif |
67 |
jpeg_calc_output_dimensions (cinfo); |
68 |
if (cinfo->output_width < width || |
69 |
cinfo->output_height < height) { |
70 |
cinfo->scale_denom /= 2; |