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.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 97378289AE for ; Sun, 22 Sep 2024 09:18:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 46E99484FA7 for ; Sun, 22 Sep 2024 09:14:42 +0200 (CEST) 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 MkBqp0Qw-OWZ for ; Sun, 22 Sep 2024 09:14:42 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id C334B485055 for ; Sun, 22 Sep 2024 09:13:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 613E2484772 for ; Sun, 22 Sep 2024 09:13:00 +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 PgglQF_dBREk for ; Sun, 22 Sep 2024 09:12:59 +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= X-Greylist: delayed 360 seconds by postgrey-1.36 at cgl.ntg.nl; Sun, 22 Sep 2024 09:12:59 CEST Received: from smtp-out.a16n.net (smtp-out.a16n.net [87.98.181.171]) by cgl.ntg.nl (Postfix) with ESMTP id E61A1484769 for ; Sun, 22 Sep 2024 09:12:59 +0200 (CEST) Received: from server.a16n.net (server.a16n.net [82.65.98.121]) by smtp-out.a16n.net (Postfix) with ESMTP id 4A6574605D2 for ; Sun, 22 Sep 2024 09:06:58 +0200 (CEST) Received: from ws.localdomain (apoitiers-654-1-63-134.w92-162.abo.wanadoo.fr [92.162.230.134]) by server.a16n.net (Postfix) with ESMTPSA id 111D7800615 for ; Sun, 22 Sep 2024 09:06:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=a16n.net; s=a16n; t=1726988818; bh=xF0E1i+yYAb31nBAoxAkZwLR06X0MnWXoSyamx+csFw=; h=From:To:Subject:In-Reply-To:References:Date; b=Cpjdw+kBCxA3iSNNRdIhL8oSay5Usn0ZArwQWctFMH/eqmLQsvOkWupC7L7pFvCP7 mtDGNwohVsUOxqTLH0rFGzz6/+h4zBSiWoduTaTamf3elMaOdjBvrHrujqITCwPrLQ 9fvAzKc4Cv+BMrVFu0I7M7XeDb59h7F+FuDUfytz9YuoHbxu15bg11tAm0v/QhaAuc c753v3oULXTXoZDRJiN+jl2FK1tGpaP9VTOtgS23AItZn1bgFDzYHPcXYvrxCeFxve VemPfWvDAIqa8kMPc1h7lHqsKvbdhHd/aCDfE5q4p4Ms+7sAVmbd26u427jQR7tcvl n1uAw9P0W2nUw== Received: by ws.localdomain (Postfix, from userid 1000) id A8E57205C0; Sun, 22 Sep 2024 09:06:57 +0200 (CEST) From: =?utf-8?Q?Peter_M=C3=BCnster?= To: ntg-context@ntg.nl In-Reply-To: <23dd9e7a-a61c-4697-998c-ac4de8273592@fiee.net> (Henning Hraban Ramm's message of "Sat, 21 Sep 2024 13:21:08 +0200") References: <23dd9e7a-a61c-4697-998c-ac4de8273592@fiee.net> Mail-Followup-To: ntg-context@ntg.nl Date: Sun, 22 Sep 2024 09:06:57 +0200 Message-ID: <87y13kqi9a.fsf@a16n.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Message-ID-Hash: Z4EB44ZTBN66CGI32TMR7Z2RNLKV3MEA X-Message-ID-Hash: Z4EB44ZTBN66CGI32TMR7Z2RNLKV3MEA 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: 8bit On Sat, Sep 21 2024, Henning Hraban Ramm wrote: > How can a converter function access … > – the final (scaled) size of a placed image Hi, I use "figures.current().request" in my module (here attached). > – the original pixel size of an image ? I use img.scan() for that. HTH, -- Peter --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=grph-downsample.lua Content-Transfer-Encoding: base64 aWYgbm90IG1vZHVsZXMgdGhlbiBtb2R1bGVzID0geyB9IGVuZCBtb2R1bGVzIFsnZ3JwaC1kb3du c2FtcGxlJ10gPSB7CiAgdmVyc2lvbiAgID0gMS4wMDEsCiAgY29tbWVudCAgID0gImNvbXBhbmlv biB0byBncnBoLWluYy5ta2l2IiwKICBhdXRob3IgICAgPSAiUGV0ZXIgTcO8bnN0ZXIiLAogIGNv cHlyaWdodCA9ICJQUkFHTUEgQURFIC8gQ29uVGVYdCBEZXZlbG9wbWVudCBUZWFtIiwKICBsaWNl bnNlICAgPSAic2VlIGNvbnRleHQgcmVsYXRlZCByZWFkbWUgZmlsZXMiCn0KCmxvY2FsIGZvcm1h dCA9IHN0cmluZy5mb3JtYX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SBjb252ZXJ0IC1yZXNpemUgJWR4JWQgJXMg JXMiLAogICAgICAgICAgICAgICAgICAgICAgICAgeHNpemUsIHlzaXplLCBvbGRuYW1lLCBuZXdu YW1lKQogICAgICAgIHByaW50KCJDb252ZXJzaW9uOiAiIC4uIHMpCiAgICAgICAgb3MuZXhlY3V0 ZShzKQogICAgZWxzZQogICAgICAgIHByaW50KGZvcm1hdCgiTm90aGluZyB0byBkbzogJXMsICVz LCAlcyIsIG9sZG5hbWUsIG5ld25hbWUsIHJlc29sdXRpb24pKQogICAgICAgIHByaW50KGZvcm1h dCgieHNpemUgPSAlZCwgeXNpemUgPSAlZCIsIHhzaXplLCB5c2l6ZSkpCiAgICBlbmQKZW5kCgps b2NhbCBmb3JtYXRzID0geyJwbmciLCAianBnIiwgImdpZiJ9Cgpmb3IgXywgcyBpbiBpcGFpcnMo Zm9ybWF0cykgZG8KICAgIGZpZ3VyZXMuY29udmVydGVyc1tzXSA9IGZpZ3VyZXMuY29udmVydGVy c1tzXSBvciB7fQogICAgZmlndXJlcy5jb252ZXJ0ZXJzW3NdWyJsb3dyZXMuIiAuLiBzXSA9IHNh bXBsZV9kb3duCmVuZAo= --=-=-= 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 ___________________________________________________________________________________ --=-=-=--