rpms/cups/devel cups-str2727.patch,NONE,1.1 cups.spec,1.397,1.398

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Thu Feb 28 22:35:53 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/cups/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17695

Modified Files:
	cups.spec 
Added Files:
	cups-str2727.patch 
Log Message:
* Thu Feb 28 2008 Tim Waugh <twaugh at redhat.com> 1:1.3.6-5
- Apply upstream fix for Adobe JPEG files (bug #166460, STR #2727).


cups-str2727.patch:

--- NEW FILE cups-str2727.patch ---
diff -up cups-1.3.6/filter/image-jpeg.c.str2727 cups-1.3.6/filter/image-jpeg.c
--- cups-1.3.6/filter/image-jpeg.c.str2727	2007-07-11 22:46:42.000000000 +0100
+++ cups-1.3.6/filter/image-jpeg.c	2008-02-28 22:28:45.000000000 +0000
@@ -47,8 +47,8 @@ _cupsImageReadJPEG(
   struct jpeg_error_mgr	jerr;		/* Error handler info */
   cups_ib_t		*in,		/* Input pixels */
 			*out;		/* Output pixels */
-  char			header[16];	/* Photoshop JPEG header */
-  int			psjpeg;		/* Non-zero if Photoshop JPEG */
+  jpeg_saved_marker_ptr	marker;		/* Pointer to marker data */
+  int			psjpeg = 0;	/* Non-zero if Photoshop CMYK JPEG */
   static const char	*cspaces[] =
 			{		/* JPEG colorspaces... */
 			  "JCS_UNKNOWN",
@@ -61,23 +61,30 @@ _cupsImageReadJPEG(
 
 
  /*
-  * Read the first 16 bytes to determine if this is a Photoshop JPEG file...
-  */
-
-  fread(header, sizeof(header), 1, fp);
-  rewind(fp);
-
-  psjpeg = memcmp(header + 6, "Photoshop ", 10) == 0;
-
- /*
   * Read the JPEG header...
   */
 
   cinfo.err = jpeg_std_error(&jerr);
   jpeg_create_decompress(&cinfo);
+  jpeg_save_markers(&cinfo, JPEG_APP0 + 14, 0xffff); /* Adobe JPEG */
   jpeg_stdio_src(&cinfo, fp);
   jpeg_read_header(&cinfo, 1);
 
+ /*
+  * Parse any Adobe APPE data embedded in the JPEG file.  Since Adobe doesn't
+  * bother following standards, we have to invert the CMYK JPEG data written by
+  * Adobe apps...
+  */
+
+  for (marker = cinfo.marker_list; marker; marker = marker->next)
+    if (marker->marker == (JPEG_APP0 + 14) && marker->data_length >= 12 &&
+        !memcmp(marker->data, "Adobe", 5) && marker->data[11] == 2)
+    {
+      fputs("DEBUG: Adobe CMYK JPEG detected (inverting color values)\n",
+	    stderr);
+      psjpeg = 1;
+    }
+
   cinfo.quantize_colors = 0;
 
   fprintf(stderr, "DEBUG: num_components = %d\n", cinfo.num_components);


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups.spec,v
retrieving revision 1.397
retrieving revision 1.398
diff -u -r1.397 -r1.398
--- cups.spec	26 Feb 2008 17:47:57 -0000	1.397
+++ cups.spec	28 Feb 2008 22:35:18 -0000	1.398
@@ -6,7 +6,7 @@
 Summary: Common Unix Printing System
 Name: cups
 Version: 1.3.6
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 Source: ftp://ftp.easysw.com/pub/cups/test//cups-%{version}-source.tar.bz2
@@ -48,6 +48,7 @@
 Patch23: cups-logrotate.patch
 Patch25: cups-usb-paperout.patch
 Patch26: cups-str2715.patch
+Patch27: cups-str2727.patch
 Patch100: cups-lspp.patch
 Epoch: 1
 Url: http://www.cups.org/
@@ -163,6 +164,7 @@
 %patch23 -p1 -b .logrotate
 %patch25 -p1 -b .usb-paperout
 %patch26 -p1 -b .str2715
+%patch27 -p1 -b .str2727
 
 %if %lspp
 %patch100 -p1 -b .lspp
@@ -427,6 +429,9 @@
 %{cups_serverbin}/daemon/cups-lpd
 
 %changelog
+* Thu Feb 28 2008 Tim Waugh <twaugh at redhat.com> 1:1.3.6-5
+- Apply upstream fix for Adobe JPEG files (bug #166460, STR #2727).
+
 * Tue Feb 26 2008 Tim Waugh <twaugh at redhat.com> 1:1.3.6-4
 - LSB header for initscript (bug #246897).
 - Move HTML-related files to main application directory so that the CUPS




More information about the fedora-extras-commits mailing list