[NTG-context] setupexternalfigures and resoĺution

Henning Hraban Ramm texml at fiee.net
Thu Sep 1 15:05:42 CEST 2022


Am 01.09.22 um 12:37 schrieb juh+ntg-context--- via ntg-context:
> 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?

According to the sources it should only attack JPEGs.

Hraban



More information about the ntg-context mailing list