[gs-cvs] gs/src
L. Peter Deutsch
lpd at casper.ghostscript.com
Mon Apr 8 14:21:34 PDT 2002
Update of /cvs/ghostscript/gs/src
In directory casper:/tmp/cvs-serv24884/src
Modified Files:
gdevpsdi.c
Log Message:
Fix: Changes the operation of AutoFilter{Gray,Color}Images to always use the
lossless filter (normally FlateEncode), rather than using DCTEncode for
8-bit-per-component images at least 64x64 in size. While this isn't
optimal, it fixes a long-standing problem that many users have complained
about. Fixes SourceForge #450663.
Index: gdevpsdi.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpsdi.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- gdevpsdi.c 21 Feb 2002 22:24:52 -0000 1.18
+++ gdevpsdi.c 8 Apr 2002 21:21:21 -0000 1.19
@@ -107,12 +107,18 @@
return 0;
if (pdip->AutoFilter) {
/*
- * Disregard the requested filter: use DCTEncode with ACSDict
- * instead (or the lossless filter if the conditions for JPEG
- * encoding aren't met).
- */
+ * Disregard the requested filter. What we should do at this point
+ * is analyze the image to decide whether to use JPEG encoding
+ * (DCTEncode with ACSDict) or the lossless filter. However, since
+ * we don't currently buffer the entire image, we don't have a way
+ * to make a good decision. Since it is always safe to use a
+ * lossless filter, while using DCTEncode may produce very
+ * bad-looking output, we always use the lossless filter.
+ */
orig_template = template =
- ( pim->Width < 64 || pim->Height < 64 ) ? lossless_template : &s_DCTE_template;
+ (pim->Width < 64 || pim->Height < 64 ?
+ lossless_template :
+ lossless_template /*&s_DCTE_template*/);
dict = pdip->ACSDict;
}
gs_c_param_list_read(dict); /* ensure param list is in read mode */
More information about the gs-cvs
mailing list