groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/01: [gropdf] Can't handle DecodeParams in Deflate filter.


From: Deri James
Subject: [groff] 01/01: [gropdf] Can't handle DecodeParams in Deflate filter.
Date: Sun, 28 Apr 2024 08:38:28 -0400 (EDT)

deri pushed a commit to branch master
in repository groff.

commit 14563f831454bd879f465ac4738624c5e3f380ed
Author: Deri James <deri@chuzzlewit.myzen.co.uk>
AuthorDate: Sun Apr 28 13:36:31 2024 +0100

    [gropdf] Can't handle DecodeParams in Deflate filter.
    
    If gropdf called with -d (debug) the pdf is produced with
    objects uncompressed, if object does not use default deflate
    parameters Zlib does not decompress properly, so the
    decompressed object is invalid. This affects when using a
    pdf imported with 'pdfpic' which contains a png image.
    
    This only affects imported pdfs when using the -d flag,
    because otherwise it is just passed through with no
    decompress.
    
    * src/devices/gropdf/gropdf.pl: Don't decompress if object has
    a DecodeParams dictionary.
---
 ChangeLog                    | 17 +++++++++++++++++
 src/devices/gropdf/gropdf.pl |  2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e1483c5ed..ba4f786e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2024-04-24  Deri James  <deri@chuzzlewit.myzen.co.uk>
+
+       [gropdf] Can't handle DecodeParams in Deflate filter.
+
+       If gropdf called with -d (debug) the pdf is produced with
+       objects uncompressed, if object does not use default deflate
+       parameters Zlib does not decompress properly, so the
+       decompressed object is invalid. This affects when using a
+       pdf imported with 'pdfpic' which contains a png image.
+
+       This only affects imported pdfs when using the -d flag,
+       because otherwise it is just passed through with no
+       decompress.
+
+       * src/devices/gropdf/gropdf.pl: Don't decompress if object has
+       a DecodeParams dictionary.
+
 2024-04-20  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/tmac.am ($(M4CHECK)): Ensure directory exists to house
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 59434a8ec..7bb1610c2 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -2577,7 +2577,7 @@ sub LoadStream
     Warn("failed to read all of the stream")
     if $l != sysread(PD,$o->{STREAM},$l);
 
-    if ($gotzlib and exists($o->{OBJ}->{'Filter'}) and $o->{OBJ}->{'Filter'} 
eq '/FlateDecode')
+    if ($gotzlib and exists($o->{OBJ}->{'Filter'}) and $o->{OBJ}->{'Filter'} 
eq '/FlateDecode' and !exists($o->{OBJ}->{'DecodeParms'}))
     {
        $o->{STREAM}=Compress::Zlib::uncompress($o->{STREAM});
        delete($o->{OBJ }->{'Filter'});



reply via email to

[Prev in Thread] Current Thread [Next in Thread]