[NTG-context] setupexternalfigures and resoĺution

juh+ntg-context at mailbox.org juh+ntg-context at mailbox.org
Thu Sep 1 12:37:11 CEST 2022


Hi Hraban,

Am 01.09.22 um 10:56 schrieb Henning Hraban Ramm via ntg-context:
> \startluacode
> local function downsampler(oldname, newname, resolution)
>      if not resolution or resolution == "" then
>          resolution = 72
>      end
>      local cmd = string.format(
>        [[gm convert -resample %ix%i %s %s]],
>        resolution, resolution, oldname, newname)
>      os.execute(cmd)
> end
> 
> -- Set the PDF and default JPEG converters to the above function.
> figures.converters.jpg.pdf = downsampler
> figures.converters.jpg.default = downsampler
> \stopluacode
> 
> I didn’t manage to plug this into the "conversion" mechanism.

Thanks a lot. With this I get 5.9MB instead of 13MB.

Maybe I can skip postprocessing the pdf file with ps2pdf.

 From an error message I guess that this script also tries to downsample 
png files. Is that correct?

juh


More information about the ntg-context mailing list