From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 91B232ECCF for ; Thu, 17 Oct 2024 13:21:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id C123A484BE3 for ; Thu, 17 Oct 2024 13:21:13 +0200 (CEST) Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=ntg.nl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntg.nl; h= list-unsubscribe:list-subscribe:list-post:list-owner:list-help :list-archive:archived-at:list-id:subject:subject:reply-to :precedence:content-type:content-type:mime-version:user-agent :message-id:date:date:references:in-reply-to:from:from:received :received:received:received:received:received:received:received; s=cgl; t=1729164070; x=1731756071; bh=l4Xy6VatsVgcQiR/WoxRi3r66 KVks68SyVkh2gpWZ2s=; b=ZRN3fEj3qYNiyeLvtznw0uOPPvKoJVZrJjBCIUtEc DWK8qtq5Da9IwmVBcap9PpNFpHpuGPtk9OceOjNVaZkpqeNTNBvoZ8xPdDVJs+YJ xlm6FkcQ6kwKTBGvZjmb2eCJ9q2qbDYTb4+h20C0V9IpRe1er5zdqSTWe5fAVnHi Fk= X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=a16n.net Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LDnPa_Jy9vNG for ; Thu, 17 Oct 2024 13:21:10 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 5FCCC484DB6 for ; Thu, 17 Oct 2024 13:12:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 0C4CB4840AF for ; Thu, 17 Oct 2024 13:11:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wr0nIZsh__cl for ; Thu, 17 Oct 2024 13:11:28 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=87.98.181.171; helo=smtp-out.a16n.net; envelope-from=pm@a16n.net; receiver= Received: from smtp-out.a16n.net (smtp-out.a16n.net [87.98.181.171]) by cgl.ntg.nl (Postfix) with ESMTP id BF82D48408F for ; Thu, 17 Oct 2024 13:11:28 +0200 (CEST) Received: from server.a16n.net (server.a16n.net [82.65.98.121]) by smtp-out.a16n.net (Postfix) with ESMTP id D43E446042D for ; Thu, 17 Oct 2024 13:11:34 +0200 (CEST) Received: from ws.localdomain (unknown [192.168.13.254]) by server.a16n.net (Postfix) with ESMTPSA id BDFB5801283 for ; Thu, 17 Oct 2024 13:11:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=a16n.net; s=a16n; t=1729163487; bh=e9A0pl2GWfQKc67iZL169sdu8X7PDM4mZhlYQazsACk=; h=From:To:Subject:In-Reply-To:References:Date; b=NeFU/ZDUnHvrbMA07zggZWqVrwNByDXQYhHy3A3XJ1BBa7saoCzzNun5vp1T97hOY N0jIwy4gp8vxCR/gHdGDktOjsAwChCzCY6fe/xbmQtAbZW3ffOVAABd2UwsEb/E39P flSWbnIL8n6uPdqGevuXRqigI75EORv7E6rjwd7PVRwY89FsxtTiYpTuxfmRWFmaBG yh17U5fPJPPskxi0ssoiT+jFbE7ekYhUiBwH3ifHim8ySJSIg7ZjSemefR48N2maXV Aflj8H6wGjZKyiCLF3SUKKz8yZ7HzyP6Fuf1SYecEUEVJqtcDSP7ie2gEWyOOymYRI vFzFOT3j7lR3Q== Received: by ws.localdomain (Postfix, from userid 1000) id 9987420625; Thu, 17 Oct 2024 13:11:27 +0200 (CEST) From: =?utf-8?Q?Peter_M=C3=BCnster?= To: ntg-context@ntg.nl In-Reply-To: <19239da4-a9c1-4f2a-93e7-d6d61d57433b@fiee.net> (Henning Hraban Ramm's message of "Wed, 16 Oct 2024 19:59:55 +0200") References: <23dd9e7a-a61c-4697-998c-ac4de8273592@fiee.net> <87y13kqi9a.fsf@a16n.net> <19239da4-a9c1-4f2a-93e7-d6d61d57433b@fiee.net> Mail-Followup-To: ntg-context@ntg.nl Date: Thu, 17 Oct 2024 13:11:27 +0200 Message-ID: <87plnzoug0.fsf@a16n.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Message-ID-Hash: O7T2GF6W6RDWUR6BFEVPAKSTV2MQQZBK X-Message-ID-Hash: O7T2GF6W6RDWUR6BFEVPAKSTV2MQQZBK X-MailFrom: pm@a16n.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Downsampling images (again) List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Oct 16 2024, Henning Hraban Ramm wrote: >> I use img.scan() for that. > > are you sure that your code works with LMTX? Hi Hraban, No, sorry, I didn=E2=80=99t test it... > Find attached my version. Thanks, I have integrated your ideas in a new version here attached. > It seems to work, but only for the first instance of an image, Yes, you need to patch the file grph-inc.lmt: https://lists.contextgarden.net/archives/list/ntg-context@ntg.nl/message/= ES7Q57MU5UIEV2B2AWEAPR66MMXI6ZHY/ Cheers, --=20 Peter --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=grph-downsample.lua Content-Transfer-Encoding: base64 aWYgbm90IG1vZHVsZXMgdGhlbiBtb2R1bGVzID0geyB9IGVuZCBtb2R1bGVzIFsnZ3JwaC1kb3du c2FtcGxlJ10gPSB7CiAgdmVyc2lvbiAgID0gMS4xMDQsCiAgY29tbWVudCAgID0gImNvbXBhbmlv biB0byBncnBoLWluYy5ta2l2IiwKICBhdXRob3IgICAgPSAiUGV0ZXIgTcO8bnN0ZXIgYW5kIEhl bm5pbmcgSHJhYmFuIFJhbW0iLAogIGNvcHlyaWdodCA9ICJQUkFHTUEgQURFIC8gQ29uVGVYdCBE ZXZlbG9wbWVudCBUZWFtIiwKICBsaWNlbnNlICAgPSAic2VlIGNvbnRleHQgcmVsYXRlZCByZWFk bWUgZmlsZXMiCn0KCi0tIHRvZG86Ci0tIGZpZ3VyZXMuY2FjaGVwYXRocy5wYXRoID0gImNhY2hl IiAtLSBzaG91bGQgYmUgYSBzZXR1cC1vcHRpb24KLS0gdGhyZXNob2xkIHNob3VsZCBiZSBhIHNl dHVwLW9wdGlvbgoKbG9jYWwgZnVuY3Rpb24gcm91bmQoeCkKICAgIHJldHVybiBtYXRoLmZsb29y KHggKyAwLjUpCmVuZAoKbG9jYWwgZm9ybWF0ID0gc3RyaW5nLmZvcm1hdApsb2NhbCByZXBvcnQg PSBsb2dzLnJlcG9ydGVyKCJET1dOU0FNUExFIikKCmxvY2FsIGZ1bmN0aW9uIHNhbXBsZV9kb3du KG9sZG5hbWUsIG5ld25hbWUsIHJlc29sdXRpb24pCiAgICByZXBvcnQoInNhbXBsZV9kb3duICVz IHRvICVzICglcykiLCBvbGRuYW1lLCBuZXduYW1lLC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uCiAg ICAgICAgaGVpZ2h0ID0gd2lkdGggLyB4eQogICAgZW5kCiAgICBsb2NhbCB4c2l6ZSA9IHJvdW5k KHJlc29sdXRpb24gKiB3aWR0aCAgLyBpbmNoKQogICAgbG9jYWwgeXNpemUgPSByb3VuZChyZXNv bHV0aW9uICogaGVpZ2h0IC8gaW5jaCkKICAgIHJlcG9ydCgicmVzaXplICVkIHggJWQgdG8gJWQg eCAlZDoiLCBpbWFnZS54c2l6ZSwgaW1hZ2UueXNpemUsCiAgICAgICAgICAgeHNpemUsIHlzaXpl KQogICAgaWYgeHNpemUgPCBpbWFnZS54c2l6ZSAqIHRocmVzaG9sZCBvciB5c2l6ZSA8IGltYWdl LnlzaXplICogdGhyZXNob2xkIHRoZW4KICAgICAgICBsb2NhbCBzID0gZm9ybWF0KCJnbSBjb252 ZXJ0IC1yZXNpemUgJWR4JWQgJXMgJXMiLAogICAgICAgICAgICAgICAgICAgICAgICAgeHNpemUs IHlzaXplLCBvbGRuYW1lLCBuZXduYW1lKQogICAgICAgIHJlcG9ydCgiY2FsbGluZzogJXMiLCBz KQogICAgICAgIG9zLmV4ZWN1dGUocykKICAgIGVsc2UKICAgICAgICByZXBvcnQoIk5vdGhpbmcg dG8gZG86ICVzLCAlcywgJXMiLCBvbGRuYW1lLCBuZXduYW1lLCByZXNvbHV0aW9uKQogICAgICAg IHJlcG9ydCgieHNpemUgPSAlZCwgeXNpemUgPSAlZCIsIHhzaXplLCB5c2l6ZSkKICAgIGVuZApl bmQKCmxvY2FsIGZvcm1hdHMgPSB7InBuZyIsICJqcGciLCAiZ2lmIn0KCmZvciBfLCBzIGluIGlw YWlycyhmb3JtYXRzKSBkbwogICAgZmlndXJlcy5jb252ZXJ0ZXJzW3NdID0gZmlndXJlcy5jb252 ZXJ0ZXJzW3NdIG9yIHt9CiAgICBmaWd1cmVzLmNvbnZlcnRlcnNbc11bImxvd3Jlcy4iIC4uIHNd ID0gc2FtcGxlX2Rvd24KZW5kCg== --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --=-=-=--