Closed GoogleCodeExporter closed 8 years ago
Could you please attach the jbig2 binary you are using (if it's not too big)?
FYI It works for me on Linux with the official jbig2 binary:
info: loaded PNG IDAT of 107922 bytes
info: executing image optimizer jbig2: jbig2 -p pso.conv-8.sam2p-pr.png
>pso.conv-8.jbig2
info: executing image optimizer pngout: pngout pso.conv-0001.pnggray.tmp.png
pso.conv-8.pngout.png
In: 148813 bytes pso.conv-0001.pnggray.tmp.png /c0 /f5 /d8
Out: 97776 bytes pso.conv-8.pngout.png /c3 /f0 /d1, 2 colors
Chg: -51037 bytes ( 65% of original)
info: loading image from: pso.conv-8.pngout.png
info: loaded PNG IDAT of 97701 bytes and PLTE of 6 bytes
info: optimized image XObject 8 file_name=pso.conv-8.jbig2 size=36812 (22%)
methods=jbig2:36812,pngout:97950,sam2p_np:108007,sam2p_pr:108172,gs:148709,#orig
:171111
info: saved 134299 bytes (78%) on optimizable images
info: eliminated 3 duplicate objs
info: eliminated 7 unused objs in 4 classes
info: writing Multivalent input PDF: pso.conv.mi.tmp.pdf
info: saving PDF with 9 objs to: pso.conv.mi.tmp.pdf
info: generated 43614 bytes (24%)
info: executing Multivalent to optimize PDF: java -cp
/home/pts/prg/pdfsizeopt/trunk/Multivalent.jar tool.pdf.Compress -nopagepiece
-noalt pso.conv.mi.tmp.pdf
file:/home/pts/prg/pdfsizeopt/trunk/pso.conv.mi.tmp.pdf, 43614 bytes
PDF 1.5, producer=ImageMagick 6.7.1-0 2011-08-06 Q16
http://www.imagemagick.org, creator=null
additional compression may be possible with:
-compact
=> new length = 37466, saved 14%, elapsed time = 0 sec
info: Multivalent generated pso.conv.mi.tmp-o.pdf of 37488 bytes (86%)
info: compressed xref stream from 16 to 130 bytes (813%)
info: optimized to 37391 bytes after Multivalent (100%)
info: saving PDF to: /tmp/t.psom.pdf
info: generated 37391 bytes (21%)
As a temporary workaround, you can use pdfsizeopt --use-jbig2=false
FYI I've attached the offending pso.conv-8.sam2p-pr.png file for which the
following command fails for you:
jbig2 -p pso.conv-8.sam2p-pr.png >pso.conv-8.jbig2
Original comment by pts...@gmail.com
on 8 Aug 2011 at 5:26
Attachments:
Thank you for your support. Here's the binary.
Original comment by tristan....@gmail.com
on 8 Aug 2011 at 9:13
Attachments:
FYI See the expected output of
jbig2 -p pso.conv-8.sam2p-pr.png >pso.conv-8.jbig2
attached.
Original comment by pts...@gmail.com
on 26 Aug 2011 at 8:28
Attachments:
[deleted comment]
Thank you for taking time to report this issue and attach all relevant files.
Based on the information you have shared, I was able to provide a fix.
The most probable reason of the failure of your jbig2 binary is that it uses a
leptonica library without png support compiled in. If you recompiled leptonica
with png support (possibly compiling libpng as well), the errors
Error in pixReadStreamPng: function not present
Error in pixReadStream: png: no pix returned
Error in pixRead: pix not read
would go away. However, this work is not necessary, because I compiled it for
you (and for other pdfsizeopt users), just download
http://pdfsizeopt.googlecode.com/files/jbig2.darwin , rename it to jbig2, chmod
+x it, and move it next to pdfsizeopt.py. Please report whether it's successful.
For me it succeeds with the command
jbig2 -p pso.conv-8.sam2p-pr.png >pso.conv-8.jbig2
, and it produces the expected output file.
FYI See the build.sh in
http://code.google.com/p/pts-mini-gpl/source/browse/#svn/trunk/build-jbig2 how
I compiled the jbig2 tool for Mac OS X 10.5. I basically downloaded the vanilla
* zlib-1.2.5.tar.gz
* libpng-1.2.46.tar.gz
* leptonica-1.68.tar.gz
* agl-jbig2enc-0.27-20-ge8be922.tar.gz
and compiled and installed them with the gcc-mp-4.4 in MacPorts.
Original comment by pts...@gmail.com
on 27 Aug 2011 at 7:46
Original issue reported on code.google.com by
tristan....@gmail.com
on 8 Aug 2011 at 4:43Attachments: