Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-gfx/xli/files: xli-1.17.0-fix-scale-zoom.patch
Date: Sat, 05 Sep 2009 22:11:48
Message-Id: E1Mk3U2-000605-7x@stork.gentoo.org
1 robbat2 09/09/05 22:11:46
2
3 Added: xli-1.17.0-fix-scale-zoom.patch
4 Log:
5 Fix bug 282979: Broken -zoom in jpeg-7, so that we can stop restricting the jpeg-6 version.
6 (Portage version: 2.2_rc40/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 media-gfx/xli/files/xli-1.17.0-fix-scale-zoom.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-gfx/xli/files/xli-1.17.0-fix-scale-zoom.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-gfx/xli/files/xli-1.17.0-fix-scale-zoom.patch?rev=1.1&content-type=text/plain
13
14 Index: xli-1.17.0-fix-scale-zoom.patch
15 ===================================================================
16 As of jpeg-7, the scale coefficents may be set to non-unitary values by the
17 initial DCT transform. This caused the original already-scale detection
18 algorithm in xli to break.
19
20 To avoid this, set the already-scaled marker when we adjust the scale fraction
21 (that gets passed into the DCT).
22
23 Signed-off-by: Robin H. Johnson <robbat2@g.o>
24
25 diff -Nuar -X x xli-2005-02-27.orig/jpeg.c xli-2005-02-27/jpeg.c
26 --- xli-2005-02-27.orig/jpeg.c 2005-02-27 16:42:39.000000000 -0800
27 +++ xli-2005-02-27/jpeg.c 2009-09-05 15:02:12.462635389 -0700
28 @@ -211,7 +211,7 @@
29 xli_jpg_err jerr;
30 Image *image = 0;
31 byte **rows = 0;
32 - int i, rowbytes;
33 + int i, rowbytes, flags;
34
35 CURRFUNC("jpegLoad");
36 zfp = zopen(fullname);
37 @@ -248,9 +248,13 @@
38 if (verbose)
39 describe_jpeg(&cinfo, fullname);
40
41 + flags = 0;
42 if (image_ops->iscale > 0 && image_ops->iscale < 4) {
43 - cinfo.scale_num = 1;
44 - cinfo.scale_denom = 1 << image_ops->iscale;
45 + flags |= FLAG_ISCALE;
46 + //cinfo.scale_num = 1;
47 + cinfo.scale_denom *= 1 << image_ops->iscale;
48 + if (verbose)
49 + printf("scaling to %d/%d\n", cinfo.scale_num, cinfo.scale_denom);
50 } else if (image_ops->iscale_auto) {
51 image_ops->iscale = 0;
52 while (image_ops->iscale < 3 && (cinfo.image_width >>
53 @@ -258,9 +262,11 @@
54 cinfo.image_height >> image_ops->iscale >
55 globals.dinfo.height * .9))
56 image_ops->iscale += 1;
57 - cinfo.scale_denom = 1 << image_ops->iscale;
58 + cinfo.scale_denom *= 1 << image_ops->iscale;
59 + if(image_ops->iscale > 0)
60 + flags |= FLAG_ISCALE;
61 if (verbose)
62 - printf("auto-scaling to 1/%d\n", cinfo.scale_denom);
63 + printf("auto-scaling to %d/%d\n", cinfo.scale_num, cinfo.scale_denom);
64 }
65 znocache(zfp);
66
67 @@ -288,8 +294,7 @@
68 }
69
70 image->gamma = RETURN_GAMMA;
71 - if (cinfo.scale_denom > 1)
72 - image->flags |= FLAG_ISCALE;
73 + image->flags |= flags;
74
75 rowbytes = cinfo.output_width * cinfo.output_components;
76 assert(image->pixlen * image->width == rowbytes);