On 19/06/2020 17:39, Phil M. Perry via RT wrote:
Show quoted text
Show quoted text> There are a couple odd things in your Perl script: 1) you use "shift" for the name fed to image_pnm, even though @_ is empty at this point. I can avoid that error by replacing "shift" with "$ARGV[0]". Can you explain what you are doing there? 2) normally you give the lower left corner x,y in the image() call. There's no telling for sure what it's using for x and y coordinates if you omit them. However, no improvement even if I add ",0,0" to the call. I also tried adding the dimensions ",2480,3506" but that didn't help.
"shift" used like that is the same as $ARGV[0], as it is a shortcut for
shift @ARGV.
Show quoted text> The PNM file itself appears to be OK -- I can display it as 2480x3506 in GIMP (grayscale 8 bit/pixel). Those are the dimensions stored in the PDF object describing the image, although the compressed stream (Flate compress) is 1047348 bytes rather than the original 8694880. Possibly something is going wrong with the compression itself -- I will have to try adding the image as UNcompressed data and see what happens. The page (media box) appears to be sufficiently large to hold the image.
>
> Let me know if you make any headway with this, as I will be looking at it from this end.
I tried out various different filters with no success.
The header of the pnm says 2480x3506, which implies a filesize of
8694919, which is what the file is (on my system).
I would expect the flate to compress it quite well, as there quite a bit
of white there. So 8x smaller is no surprise.