From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/109197 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jano Kula Newsgroups: gmane.comp.tex.context Subject: caching remote images Date: Wed, 4 Nov 2020 11:14:44 +0100 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2050764643811959431==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10462"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Nov 04 11:15:43 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kaFpP-0002dr-5O for gctc-ntg-context-518@m.gmane-mx.org; Wed, 04 Nov 2020 11:15:43 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7FF4F1A9412; Wed, 4 Nov 2020 11:15:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zrJgBo5hzhZT; Wed, 4 Nov 2020 11:15:24 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A97EF1A9D42; Wed, 4 Nov 2020 11:15:24 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6C8A31A9CFB for ; Wed, 4 Nov 2020 11:15:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZREhqMqGcYrp for ; Wed, 4 Nov 2020 11:15:22 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.167.173; helo=mail-oi1-f173.google.com; envelope-from=jano.kula@gmail.com; receiver= Original-Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id BB9121A9D42 for ; Wed, 4 Nov 2020 11:15:22 +0100 (CET) Original-Received: by mail-oi1-f173.google.com with SMTP id m143so12296619oig.7 for ; Wed, 04 Nov 2020 02:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=I79jHtJGMbFUD08QwTmKPsAJa71aYilLRkAfDUt0rcY=; b=Rwoofv3U6iixAn8TSHCOunM/93OS5YpH0FOdaG36ea7dgksNJU/xn5cfCSBeo0OdiT qYHvvGZbAPlNCC+8k4EwpPCsuKYkYllORtWdQkpxe5R2ZDkiYx9HOlNSp4VhDfgBZeM3 v7H6XA72XDt4EdhW2+8I71T+dw1sEx0RyaQGxwXQBYOkaNAwJulNtgKzkCNUmy81p6cu +cg4/t0jUR0GvjYvvtEJ6E1JBQrnJyAVQ45RK7lwFnJSc/tUnNs+5vXfaAzIn8uw71D1 ceZdEU045uY3DlUnwTm3bz+HeL30EQ6q6IXjKQzp1ngD+vjWYS9Gj+Tbtz+tKkiMFL0Y O5dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=I79jHtJGMbFUD08QwTmKPsAJa71aYilLRkAfDUt0rcY=; b=tXB4ZHnKOrZPX9kt6i0dMFiVab1a78GjEnmYvMwPlwDnzJSDGFvDEznkY38HyobQur XeoEDqLcRNzmZ89gIQ/kwu5XEcRX79CUTLwFkD/OHI8Q9b70AE34V+kToS3JZ02SZAS1 qOBrUJWTbnPzketjRqhXe/1FvvwF/ya6uD9YZBYVVYzctJMIgp8XTTe7DW50MksfpA4G gGYLGxwTbNPOfMVu77CTFv27RFQyN1iLjz1xYvyBz9+NztfKc9iEU54LSg4dHS4UA92I +HQ3I7S9XViWpWnEeYdj2uElsh9r73m9wz+nNoJ5+BzmOg72PwlWtdDVd/AKeVCXgSSO BRjA== X-Gm-Message-State: AOAM532Xh/b72J89XHJ8TP/KvljQbv6VJ3BpyZoLrr7Sa5MoF2KPyNvX hRmNcGTcvF3KHNEnNGNxssIWIhB/QuAdPJMJxHGBYNEUkg9yAg== X-Google-Smtp-Source: ABdhPJxxxOFeDd4kDwvwW6ScSGGsDpvGuNVpqNrqnev8efsoLd9KUZijDvxfBx1sNLXi931GBR7xKmsrfb1YfIURncA= X-Received: by 2002:a54:4011:: with SMTP id x17mr2226001oie.142.1604484920814; Wed, 04 Nov 2020 02:15:20 -0800 (PST) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:109197 Archived-At: --===============2050764643811959431== Content-Type: multipart/alternative; boundary="000000000000c0af4205b3454145" --000000000000c0af4205b3454145 Content-Type: text/plain; charset="UTF-8" Hello! I'd like to cache images (order of hundreds) from a remote location (not all the time mapped as drive, download speed and amount of data are also the factors). \usepath[dirfile://./resources/**] is likely for speeding up searching not downloading and I don't know when new images are available (when to delete dirlist.* files), as described in workflows-mkiv.pdf. Looks like the cache parameter in \externalfigure is used only if some conversion is going on. I could create a conversion which does nothing or only envelopes JPG in PDF as .jpg.pdf (loading could be faster) and then: if cached file exists use cached .jpg.pdf else if drive is mapped download, convert and cache .jpg else skip file end end The source file with one will never change or I could re-cache from time to time to have up-to-date images cached. Before reinventing the wheel: isn't such functionality or part of it already available? Thanks, Jano --000000000000c0af4205b3454145 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

I'd like to cache=C2=A0i= mages (order of hundreds) from a remote location (not all the time mapped as drive, download speed and amount of data are also the factors).= =C2=A0

\usepath[dirfile://./resources/**] is likely for spee= ding up searching not downloading and I don't know when new images are = available (when to delete=C2=A0dirlist.* fi= les), as described=C2=A0in workflows-mkiv.pdf.

Looks like the cache<= /font> parameter=C2=A0in \externalfigure is= used only if some conversion is going on.

I c= ould create a conversion which=C2=A0does nothing or only envelopes JPG in P= DF as <id>.jpg.pdf=C2=A0(loading coul= d be faster) and then:

if= cached file exists
=C2=A0 =C2=A0= =C2=A0 =C2=A0 use cached <id>.jpg.pdf
=C2=A0 =C2=A0 else
= =C2=A0 =C2=A0 if drive is mapped
=C2=A0 =C2=A0 =C2=A0 =C2=A0 download, convert and cache <id&g= t;.jpg
=C2=A0 =C2=A0 else<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 skip fi= le
=C2=A0 =C2=A0= end
end
<= /div>

The source file with one <id> will never cha= nge or I could re-cache from time to time to have up-to-date images cached.=

Before reinventing=C2=A0the wheel: isn't such= functionality or part of it already available?

Th= anks,
Jano
--000000000000c0af4205b3454145-- --===============2050764643811959431== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2050764643811959431==--