Re: [NTG-context] names of cached images

2021-07-02 Thread Jano Kula
Hi Aditya!

On Fri, Jul 2, 2021, 17:43 Aditya Mahajan  wrote:

>
> On Fri, 2 Jul 2021, Jano Kula wrote:
>
> > Hello again,
> >
> > likely a bug and one question. Using this code with lmtx:
> >
> > \starttext
> > \externalfigure[mill][width=40mm,cache=./first,conversion=gray.pdf] %
> > mill...
> > \externalfigure[mill][width=40mm,cache=.,conversion=gray.pdf]   %
> > m_k_i_v_mill...
> > \externalfigure[mill][width=40mm,cache=./second]% no
> > visible caching
> > \stoptext
> >
> > *First two figures*
> > Chached image in the ./cache subdirectory has a lmtx name without prefix,
> > the cached image in the current directory has mkiv syntax with  m_k_i_v_
> > prefix.
> >
> > *Third figure*
> > The images are cached to a specified directory, only when some conversion
> > is used. I'd like to cache images without any transformation. Is there
> any
> > conversion which doesn't alter the figure, just caches it? Is new
> > conversion type needed? Or is there other way to force caching without
> > conversion?
>
> Conversion is costly and that is why caching makes sense there. What is
> the benefit of caching (i.e., simply copying the file to a different
> directory) when there is no conversion?
>

Images are on the remote sever and I don't want to download them with every
run. Images don't change, changed ones have different ID. Encapsualating
jpgs into pdfs might be the right conversion, because pdf inclusion is
fast, right? So I probably answered myself: write a conversion jpg -> pdf
without any changes to the image.

J.



> Aditya
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] names of cached images

2021-07-02 Thread Aditya Mahajan

On Fri, 2 Jul 2021, Jano Kula wrote:

> Hello again,
> 
> likely a bug and one question. Using this code with lmtx:
> 
> \starttext
> \externalfigure[mill][width=40mm,cache=./first,conversion=gray.pdf] %
> mill...
> \externalfigure[mill][width=40mm,cache=.,conversion=gray.pdf]   %
> m_k_i_v_mill...
> \externalfigure[mill][width=40mm,cache=./second]% no
> visible caching
> \stoptext
> 
> *First two figures*
> Chached image in the ./cache subdirectory has a lmtx name without prefix,
> the cached image in the current directory has mkiv syntax with  m_k_i_v_
> prefix.
> 
> *Third figure*
> The images are cached to a specified directory, only when some conversion
> is used. I'd like to cache images without any transformation. Is there any
> conversion which doesn't alter the figure, just caches it? Is new
> conversion type needed? Or is there other way to force caching without
> conversion?

Conversion is costly and that is why caching makes sense there. What is the 
benefit of caching (i.e., simply copying the file to a different directory) 
when there is no conversion?

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] names of cached images

2021-07-02 Thread Jano Kula
Hello again,

likely a bug and one question. Using this code with lmtx:

\starttext
\externalfigure[mill][width=40mm,cache=./first,conversion=gray.pdf] %
mill...
\externalfigure[mill][width=40mm,cache=.,conversion=gray.pdf]   %
m_k_i_v_mill...
\externalfigure[mill][width=40mm,cache=./second]% no
visible caching
\stoptext

*First two figures*
Chached image in the ./cache subdirectory has a lmtx name without prefix,
the cached image in the current directory has mkiv syntax with  m_k_i_v_
prefix.

*Third figure*
The images are cached to a specified directory, only when some conversion
is used. I'd like to cache images without any transformation. Is there any
conversion which doesn't alter the figure, just caches it? Is new
conversion type needed? Or is there other way to force caching without
conversion?

Thank you,
Jano


On Wed, Jun 9, 2021 at 3:23 PM Jano Kula  wrote:

> Hello Hans,
>
> On Sun, Jun 6, 2021 at 4:56 PM Hans Hagen  wrote:
>
>> On 6/6/2021 1:16 PM, Jano Kula wrote:
>> > Hello list,
>> >
>> > usingconversion=gray.pdf in lmtx the cached images' names have some
>> > string in their name. I thought it's a name of random sequence of
>> luatex
>> > cache, but the string is the same on other machines and I don't know,
>> > where it comes from. mkiv used to have m_k_i_v_ string there.
>> >
>> > hacker.pdf = source image
>> > hacker_jpg_c60ccda70ef92e32d7a6334f31c23259.gray.pdf = cached linux
>> > hacker_jpg_c60ccda70ef92e32d7a6334f31c23259.gray.pdf = cached win
>> >
>> > MWE
>> > \starttext
>> > \externalfigure[hacker]
>> >  [cache=./,
>> >  conversion=gray.pdf]
>> > \stoptext
>> >
>> > Is it intended behavior?
>> sure, something like that is always intended; it's an md5 of a hash of
>> all relevant parameters so that when you change one (say the resolution)
>> we now that we need to update
>>
>
> Thank you, wiki updated.
> J.
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] names of cached images

2021-06-09 Thread Jano Kula
Hello Hans,

On Sun, Jun 6, 2021 at 4:56 PM Hans Hagen  wrote:

> On 6/6/2021 1:16 PM, Jano Kula wrote:
> > Hello list,
> >
> > usingconversion=gray.pdf in lmtx the cached images' names have some
> > string in their name. I thought it's a name of random sequence of luatex
> > cache, but the string is the same on other machines and I don't know,
> > where it comes from. mkiv used to have m_k_i_v_ string there.
> >
> > hacker.pdf = source image
> > hacker_jpg_c60ccda70ef92e32d7a6334f31c23259.gray.pdf = cached linux
> > hacker_jpg_c60ccda70ef92e32d7a6334f31c23259.gray.pdf = cached win
> >
> > MWE
> > \starttext
> > \externalfigure[hacker]
> >  [cache=./,
> >  conversion=gray.pdf]
> > \stoptext
> >
> > Is it intended behavior?
> sure, something like that is always intended; it's an md5 of a hash of
> all relevant parameters so that when you change one (say the resolution)
> we now that we need to update
>

Thank you, wiki updated.
J.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] names of cached images

2021-06-06 Thread Hans Hagen

On 6/6/2021 1:16 PM, Jano Kula wrote:

Hello list,

usingconversion=gray.pdf in lmtx the cached images' names have some 
string in their name. I thought it's a name of random sequence of luatex 
cache, but the string is the same on other machines and I don't know, 
where it comes from. mkiv used to have m_k_i_v_ string there.


hacker.pdf = source image
hacker_jpg_c60ccda70ef92e32d7a6334f31c23259.gray.pdf = cached linux
hacker_jpg_c60ccda70ef92e32d7a6334f31c23259.gray.pdf = cached win

MWE
\starttext
\externalfigure[hacker]
     [cache=./,
     conversion=gray.pdf]
\stoptext

Is it intended behavior?
sure, something like that is always intended; it's an md5 of a hash of 
all relevant parameters so that when you change one (say the resolution) 
we now that we need to update


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] names of cached images

2021-06-06 Thread Jano Kula
Hello list,

using conversion=gray.pdf in lmtx the cached images' names have some string
in their name. I thought it's a name of random sequence of luatex cache,
but the string is the same on other machines and I don't know, where it
comes from. mkiv used to have m_k_i_v_ string there.

hacker.pdf = source image
hacker_jpg_c60ccda70ef92e32d7a6334f31c23259.gray.pdf = cached linux
hacker_jpg_c60ccda70ef92e32d7a6334f31c23259.gray.pdf = cached win

MWE
\starttext
\externalfigure[hacker]
[cache=./,
conversion=gray.pdf]
\stoptext

Is it intended behavior?

Thanks,
Jano
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___