| <<<Back 1 day (to 2018/03/04) | 20180305 |
chrisl | cybrNaut: pdfimage8 and co are not in a Ghostscript release, yet - unless you have built from source pulled from out git repo, the device won't exist | 07:42.32 |
cybrNaut | chrisl: ok, thanks. what i'm doing now is converting from PDF to PPM, and back. Guess that's the best option | 19:13.43 |
| (using pdftoppm and imagemagick) | 19:13.58 |
ray_laptop | cybrNaut: BTW, you can use gs for both steps: gs -sDEVICE=ppmraw -o temp.ppm ... in.pdf then: gs -sDEVICE=pdfwrite -o out.pdf -dSCALE=1 -- lib/biewpbm.ps temp.ppm | 20:08.42 |
cybrNaut | ray_laptop: thanks, i might prefer that | 20:18.49 |
| it's annoying that ImageMagick downsamples it w/out me telling it | 20:19.04 |
| so I have to "convert source.pbm -density 600 -units pixelsperhinch target.pdf" just to keep the dpi at 600 | 20:19.40 |
| i'm surprised I would need -dSCALE=1 in the cmd you give, but at least it relieves me of having to hardcode dpi | 20:20.39 |
ray_laptop | cybrNaut: I'll have to check what the default downsampling is for pdfwrite. (kens would know right off, but I don't). Just a sec. | 20:28.59 |
| cybrNaut: OK according to https://www.ghostscript.com/doc/current/VectorDevices.htm#PDFWRITE DownSample***Images is false by default. | 20:35.21 |
cybrNaut | sounds sensible | 20:35.36 |
| that lib/biewpbm.ps looks a bit cryptic | 20:36.33 |
| maybe it's normal.. i don't have a lot of gs experience | 20:36.52 |
Robin_Watts | cybrNaut: That's postscript. Cryptic is good. :) | 20:38.55 |
ray_laptop | so the source image from the ppm will be sent through to pdfwrite by viewpbm.ps and it will be in the final PDF. I tried with: gswin32c -r600 -sDEVICE=ppmraw -o temp.ppm examples/colorcir.ps ; gswin32c -sDEVICE=pdfwrite -o out.pdf -- lib/viewpbm.ps temp.ppm | 20:40.29 |
| and the output PDF has an image that is 5100 x 6600 pixels, as expected | 20:41.19 |
cybrNaut | sounds good.. i'm just about to try it | 20:41.40 |
| it's in a script, so i guess I should add -q -dNOPAUSE -dBATCH | 20:41.58 |
ray_laptop | cybrNaut: -o accomplishes the -dNOPAUSE -dBATCH as well as setting the OutputFile | 20:42.59 |
cybrNaut | ok, cool | 20:43.12 |
ray_laptop | but -q might be nice | 20:43.13 |
| I have to run an errand. I'll check back in a bit | 20:43.34 |
cybrNaut | i ended up with 300 dpi. I had -r600 in the rasterization cmd, but didn't think I needed it in the PDF containerization | 20:43.54 |
ray_laptop | Robin_Watts: I find that I get a lot of false problems trying to use Mememto with a multi-threaded gs. the gs_heap_free_block unlocks the monitor *BEFORE* calling "free" so Memento is unprotected when it tries to maintain its freelist | 20:45.09 |
Robin_Watts | ray_laptop: Does memento not have a monitor of its own? | 20:45.39 |
ray_laptop | I'm dying in Memento_Internal_makeSpace | 20:45.44 |
| Robin_Watts: I don't see one | 20:46.25 |
| Robin_Watts: I have to run an errand. bbiaw | 20:46.39 |
Robin_Watts | ray_laptop: oops. Yes, we appear to be missing that. | 20:47.27 |
cybrNaut | https://paste.gnome.org/pleqh8fkp <= pbm to pdf not working | 20:53.08 |
| strange that my script does not error.. but when I run that on the CLI it falls over | 20:54.22 |
Robin_Watts | biew ? | 20:56.18 |
| view | 20:56.20 |
cybrNaut | it's lib/biewpbm.ps in both my script and CLI as ray_laptop gave it.. but I'll switch | 20:57.38 |
| when I switch to lib/viewpbm.ps it behaves just the same (no error in the script but results in 300 dpi, and cli error is the same as pasted) | 20:59.21 |
| https://paste.gnome.org/paymwqmsm <= with viewpbm.ps.. basically the same result | 21:00.48 |
Robin_Watts | Ok, so it's complaining that it can't find the script lib/viewpbm.ps | 21:02.23 |
| I'm guessing that's because you're not in the gs directory? | 21:02.35 |
| Use the correct path to the script. | 21:02.45 |
cybrNaut | ok.. i just figured it knew where to root that | 21:03.16 |
| but strange that in a script it doesn't complain, and generates something | 21:03.58 |
| will use /usr/share/ghostscript/9.20/lib/viewpbm.ps | 21:04.15 |
| error is gone, but seems to be upsampling to 720dpi | 21:06.02 |
| err, no actually it's always downsampling to 300dpi | 21:07.44 |
| 720 was another test | 21:07.56 |
| produces a PDF that contains a 300dpi image => gs -sDEVICE=pdfwrite -q -dSCALE=1 -r600 -o raster.pdf -- /usr/share/ghostscript/9.20/lib/viewpbm.ps raster_600dpi.pbm | 21:09.33 |
| it should be 600 dpi.. I even supplied "-dSCALE=1 -r600" to force 600dpi | 21:10.14 |
| the rasterization works correctly, so it's the conversion back to pdf that fails to maintain the resolution | 21:11.13 |
| wtf.. it all works on the CLI => https://paste.gnome.org/ps1exjeit | 21:24.23 |
| but only if I include "-dSCALE=1 -r600" on the final step (which should be implied IMO) | 21:24.45 |
| okay, sorry the script had a bug.. so the script works the same as the CLI | 21:30.47 |
| but still a mystery that I need "-dSCALE=1 -r600" | 21:30.57 |
ray_laptop | back now | 22:19.56 |
| Robin_Watts: should I open a bug about Memento MT ? | 22:20.18 |
| (and assign it to you, of course ;-) ) | 22:20.34 |
| Forward 1 day (to 2018/03/06)>>> | |