• R/O
  • SSH

GM: Commit

Main GraphicsMagick source repository


Commit MetaInfo

Revision2771be055aa4e59b141cac06f512ca541fd86a8d (tree)
Time2005-04-02 08:50:18
AuthorBob Friesenhahn <bfriesen@Grap...>
CommiterBob Friesenhahn

Log Message

* coders/pdf.c (WritePDFImage): Integrate fixes for Ghoscript 8.50
warning from the 1.1 branch.

Change Summary

Incremental Difference

diff -r 86d8b50455e6 -r 2771be055aa4 ChangeLog
--- a/ChangeLog Fri Apr 01 17:35:45 2005 -0600
+++ b/ChangeLog Fri Apr 01 17:50:18 2005 -0600
@@ -1,5 +1,7 @@
11 2005-04-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
22
3+ * coders/pdf.c (WritePDFImage): Integrate fixes for Ghoscript 8.50
4+ warning from the 1.1 branch.
35 * magick/tempfile.c (DestroyTemporaryFiles): Back port memory leak
46 fix from version 1.1.
57
diff -r 86d8b50455e6 -r 2771be055aa4 coders/pdf.c
--- a/coders/pdf.c Fri Apr 01 17:35:45 2005 -0600
+++ b/coders/pdf.c Fri Apr 01 17:50:18 2005 -0600
@@ -1013,7 +1013,11 @@
10131013 (void) WriteBlobString(image,buffer);
10141014 switch (compression)
10151015 {
1016- case NoCompression: FormatString(buffer,CFormat,"ASCII85Decode"); break;
1016+ case NoCompression:
1017+ {
1018+ FormatString(buffer,CFormat,"ASCII85Decode");
1019+ break;
1020+ }
10171021 case JPEGCompression:
10181022 {
10191023 FormatString(buffer,CFormat,"DCTDecode");
@@ -1023,8 +1027,16 @@
10231027 (void) strcpy(buffer,"/Decode [1 0 1 0 1 0 1 0]\n");
10241028 break;
10251029 }
1026- case LZWCompression: FormatString(buffer,CFormat,"LZWDecode"); break;
1027- case ZipCompression: FormatString(buffer,CFormat,"FlateDecode"); break;
1030+ case LZWCompression:
1031+ {
1032+ FormatString(buffer,CFormat,"LZWDecode");
1033+ break;
1034+ }
1035+ case ZipCompression:
1036+ {
1037+ FormatString(buffer,CFormat,"FlateDecode");
1038+ break;
1039+ }
10281040 case FaxCompression:
10291041 {
10301042 (void) strcpy(buffer,"/Filter [ /CCITTFaxDecode ]\n");
@@ -1034,7 +1046,11 @@
10341046 CCITTParam,image->columns,image->rows);
10351047 break;
10361048 }
1037- default: FormatString(buffer,CFormat,"RunLengthDecode"); break;
1049+ default:
1050+ {
1051+ FormatString(buffer,CFormat,"RunLengthDecode");
1052+ break;
1053+ }
10381054 }
10391055 (void) WriteBlobString(image,buffer);
10401056 FormatString(buffer,"/Width %lu\n",image->columns);
@@ -1127,9 +1143,11 @@
11271143 break;
11281144 }
11291145 }
1146+#if defined(HasZLIB)
11301147 if (compression == ZipCompression)
11311148 status=ZLIBEncodeImage(image,length,image_info->quality,pixels);
11321149 else
1150+#endif /* defined(HasZLIB) */
11331151 if (compression == LZWCompression)
11341152 status=LZWEncodeImage(image,length,pixels);
11351153 else
@@ -1250,9 +1268,11 @@
12501268 break;
12511269 }
12521270 }
1271+#if defined(HasZLIB)
12531272 if (compression == ZipCompression)
12541273 status=ZLIBEncodeImage(image,length,image_info->quality,pixels);
12551274 else
1275+#endif /* defined(HasZLIB) */
12561276 if (compression == LZWCompression)
12571277 status=LZWEncodeImage(image,length,pixels);
12581278 else
@@ -1346,9 +1366,11 @@
13461366 break;
13471367 }
13481368 }
1369+#if defined(HasZLIB)
13491370 if (compression == ZipCompression)
13501371 status=ZLIBEncodeImage(image,length,image_info->quality,pixels);
13511372 else
1373+#endif /* defined(HasZLIB) */
13521374 if (compression == LZWCompression)
13531375 status=LZWEncodeImage(image,length,pixels);
13541376 else
@@ -1440,7 +1462,11 @@
14401462 (void) WriteBlobString(image,"<<\n");
14411463 switch (compression)
14421464 {
1443- case NoCompression: FormatString(buffer,CFormat,"ASCII85Decode"); break;
1465+ case NoCompression:
1466+ {
1467+ FormatString(buffer,CFormat,"ASCII85Decode");
1468+ break;
1469+ }
14441470 case JPEGCompression:
14451471 {
14461472 FormatString(buffer,CFormat,"DCTDecode");
@@ -1450,8 +1476,18 @@
14501476 (void) strcpy(buffer,"/Decode [1 0 1 0 1 0 1 0]\n");
14511477 break;
14521478 }
1453- case LZWCompression: FormatString(buffer,CFormat,"LZWDecode"); break;
1454- case ZipCompression: FormatString(buffer,CFormat,"FlateDecode"); break;
1479+ case LZWCompression:
1480+ {
1481+ FormatString(buffer,CFormat,"LZWDecode");
1482+ break;
1483+ }
1484+#if defined(HasZLIB)
1485+ case ZipCompression:
1486+ {
1487+ FormatString(buffer,CFormat,"FlateDecode");
1488+ break;
1489+ }
1490+#endif /* defined(HasZLIB) */
14551491 case FaxCompression:
14561492 {
14571493 (void) strcpy(buffer,"/Filter [ /CCITTFaxDecode ]\n");
@@ -1546,9 +1582,11 @@
15461582 p++;
15471583 }
15481584 }
1585+#if defined(HasZLIB)
15491586 if (compression == ZipCompression)
15501587 status=ZLIBEncodeImage(image,length,image_info->quality,pixels);
15511588 else
1589+#endif /* defined(HasZLIB) */
15521590 if (compression == LZWCompression)
15531591 status=LZWEncodeImage(image,length,pixels);
15541592 else
@@ -1655,9 +1693,11 @@
16551693 p++;
16561694 }
16571695 }
1696+#if defined(HasZLIB)
16581697 if (compression == ZipCompression)
16591698 status=ZLIBEncodeImage(image,length,image_info->quality,pixels);
16601699 else
1700+#endif /* defined(HasZLIB) */
16611701 if (compression == LZWCompression)
16621702 status=LZWEncodeImage(image,length,pixels);
16631703 else
@@ -1738,9 +1778,11 @@
17381778 for (x=0; x < (long) tile_image->columns; x++)
17391779 *q++=indexes[x];
17401780 }
1781+#if defined(HasZLIB)
17411782 if (compression == ZipCompression)
17421783 status=ZLIBEncodeImage(image,length,image_info->quality,pixels);
17431784 else
1785+#endif /* defined(HasZLIB) */
17441786 if (compression == LZWCompression)
17451787 status=LZWEncodeImage(image,length,pixels);
17461788 else
@@ -1787,21 +1829,16 @@
17871829 FormatString(buffer,"%lu\n",(unsigned long) offset);
17881830 (void) WriteBlobString(image,buffer);
17891831 (void) WriteBlobString(image,"endobj\n");
1790- if ((image->storage_class == DirectClass) || (image->colors > 256) ||
1791- (compression == FaxCompression))
1832+ /*
1833+ Write Colormap object.
1834+ */
1835+ xref[object++]=TellBlob(image);
1836+ FormatString(buffer,"%lu 0 obj\n",object);
1837+ (void) WriteBlobString(image,buffer);
1838+ (void) WriteBlobString(image,"<<\n");
1839+ if ((image->storage_class != DirectClass) && (image->colors <= 256) &&
1840+ (compression != FaxCompression))
17921841 {
1793- xref[object++]=0;
1794- xref[object++]=0;
1795- }
1796- else
1797- {
1798- /*
1799- Write Colormap object.
1800- */
1801- xref[object++]=TellBlob(image);
1802- FormatString(buffer,"%lu 0 obj\n",object);
1803- (void) WriteBlobString(image,buffer);
1804- (void) WriteBlobString(image,"<<\n");
18051842 if (compression == NoCompression)
18061843 (void) WriteBlobString(image,"/Filter [ /ASCII85Decode ]\n");
18071844 FormatString(buffer,"/Length %lu 0 R\n",object+1);
@@ -1812,36 +1849,36 @@
18121849 if (compression == NoCompression)
18131850 Ascii85Initialize(image);
18141851 for (i=0; i < (long) image->colors; i++)
1815- {
1816- if (compression == NoCompression)
1817- {
1818- Ascii85Encode(image,ScaleQuantumToChar(image->colormap[i].red));
1819- Ascii85Encode(image,ScaleQuantumToChar(image->colormap[i].green));
1820- Ascii85Encode(image,ScaleQuantumToChar(image->colormap[i].blue));
1821- continue;
1822- }
1823- (void) WriteBlobByte(image,
1824- ScaleQuantumToChar(image->colormap[i].red));
1825- (void) WriteBlobByte(image,
1826- ScaleQuantumToChar(image->colormap[i].green));
1827- (void) WriteBlobByte(image,
1828- ScaleQuantumToChar(image->colormap[i].blue));
1829- }
1852+ {
1853+ if (compression == NoCompression)
1854+ {
1855+ Ascii85Encode(image,ScaleQuantumToChar(image->colormap[i].red));
1856+ Ascii85Encode(image,ScaleQuantumToChar(image->colormap[i].green));
1857+ Ascii85Encode(image,ScaleQuantumToChar(image->colormap[i].blue));
1858+ continue;
1859+ }
1860+ (void) WriteBlobByte(image,
1861+ ScaleQuantumToChar(image->colormap[i].red));
1862+ (void) WriteBlobByte(image,
1863+ ScaleQuantumToChar(image->colormap[i].green));
1864+ (void) WriteBlobByte(image,
1865+ ScaleQuantumToChar(image->colormap[i].blue));
1866+ }
18301867 if (compression == NoCompression)
18311868 Ascii85Flush(image);
1832- offset=TellBlob(image)-offset;
1833- (void) WriteBlobString(image,"\nendstream\n");
1834- (void) WriteBlobString(image,"endobj\n");
1835- /*
1836- Write Length object.
1837- */
1838- xref[object++]=TellBlob(image);
1839- FormatString(buffer,"%lu 0 obj\n",object);
1840- (void) WriteBlobString(image,buffer);
1841- FormatString(buffer,"%lu\n",(unsigned long) offset);
1842- (void) WriteBlobString(image,buffer);
1843- (void) WriteBlobString(image,"endobj\n");
18441869 }
1870+ offset=TellBlob(image)-offset;
1871+ (void) WriteBlobString(image,"\nendstream\n");
1872+ (void) WriteBlobString(image,"endobj\n");
1873+ /*
1874+ Write Length object.
1875+ */
1876+ xref[object++]=TellBlob(image);
1877+ FormatString(buffer,"%lu 0 obj\n",object);
1878+ (void) WriteBlobString(image,buffer);
1879+ FormatString(buffer,"%lu\n",(unsigned long) offset);
1880+ (void) WriteBlobString(image,buffer);
1881+ (void) WriteBlobString(image,"endobj\n");
18451882 if (image->next == (Image *) NULL)
18461883 break;
18471884 image=SyncNextImageInList(image);
diff -r 86d8b50455e6 -r 2771be055aa4 www/Changelog.html
--- a/www/Changelog.html Fri Apr 01 17:35:45 2005 -0600
+++ b/www/Changelog.html Fri Apr 01 17:50:18 2005 -0600
@@ -56,6 +56,8 @@
5656 2005-04-01 Bob Friesenhahn &lt;bfriesen@simple.dallas.tx.us&gt;
5757
5858 <UL>
59+ <LI> coders/pdf.c (WritePDFImage): Integrate fixes for Ghoscript 8.50
60+ warning from the 1.1 branch.<BR>
5961 <LI> magick/tempfile.c (DestroyTemporaryFiles): Back port memory leak
6062 fix from version 1.1.
6163
Show on old repository browser