[NTG-context] shrink JPGs to some resolution (dpi) ?

Peter M√ľnster pmlists at free.fr
Tue Mar 10 10:08:07 CET 2015


On Tue, Mar 10 2015, Harald Koenig wrote:

> but how do I use it ?

- Copy grph-downsample.lua to
  .../context/tex/texmf-local/tex/context/third/grph-downsample/grph-downsample.lua

- context --generate

- Copy hacker.jpg to your directory.

- Write this to test.tex:

--8<---------------cut here---------------start------------->8---
\loadluafile[grph-downsample]
\setupexternalfigures[conversion=lowres.jpg, resolution=10]
\starttext
\externalfigure[hacker.jpg][width=5cm]
\stoptext
--8<---------------cut here---------------end--------------->8---

- Then: "context test" (I hope it works...)

- Perhaps wikify it.


>     first-setup.sh --modules="grph-downsample"
>
> which removed the unzipped module:-(

Unfortunately, grph-downsample is not in the context-suite.
Mojca, could you add it?


> what's the "real way" here ?

For now, you have to put it to texmf-local.


> next problem: how to use your module ?  
> I can't find the docs and just a 
>
>   \usemodule[grph-downsample]

\loadluafile seems to do the trick, but perhaps there is an official
"context-way", Hans?


> btw, I've added your suggested patch to grph-inc.lua

The patch is only needed, when you change the size of the image, for
example 5cm -> 6cm. Without the patch, the down-sampled file won't be
regenerated.

-- 
           Peter


More information about the ntg-context mailing list