From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5171 invoked from network); 17 Jul 2023 17:13:32 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 17 Jul 2023 17:13:32 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 31E384829CF for ; Mon, 17 Jul 2023 19:11:25 +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 FDBi2X2afcq1 for ; Mon, 17 Jul 2023 19:11:24 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id D0704482A13 for ; Mon, 17 Jul 2023 19:10:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 8F88A480EC0 for ; Mon, 17 Jul 2023 19:10:15 +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 zewFFCkHtGUS for ; Mon, 17 Jul 2023 19:10:15 +0200 (CEST) Received: from st43p00im-ztbu10063701.me.com (st43p00im-ztbu10063701.me.com [17.58.63.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 347BA480E33 for ; Mon, 17 Jul 2023 19:10:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1689613814; bh=dJcD/mRUXWo8DHeG30mQ4zJSJeykEWvk9lWwpI4aHZM=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; b=Agz5q5KlUp6LP9WjpJ4VIPAJsPRBHDCVCGEp8Exny0+jrBHDdj5KZW2nBYxa+3an9 Tr+N2kSGpUJg6qXxQWHHpsgAZwnEh+K4I/m8WMngbtt/X7loKHmaRbNdHNGbeWYuKk P2qrGeoaoqLBOPIFI2lA51HWZ/mgYo6S4hl0uRf/dVih5/K7Z5m6a4Jn8rK1sZGSrN pviEU21RaVhZ6F7ioI6NT0mM+o7ojnaRJ9i+EVSPo8qUuJvz8vezZXOsu7xIZqxr7F 6EHSYrSJODLOdVOiZ8flKmEHQVIxyMdqJePXTrBd1QH9jk8+PuxaO7wkGpk1SBzpfq 5CqaXADZ4hfDw== Received: from [192.168.1.147] (st43p00im-dlb-asmtp-mailmevip.me.com [17.42.251.41]) by st43p00im-ztbu10063701.me.com (Postfix) with ESMTPSA id C316AD0075E; Mon, 17 Jul 2023 17:10:13 +0000 (UTC) Message-ID: Date: Mon, 17 Jul 2023 19:10:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: mailing list for ConTeXt users , Henning Hraban Ramm References: <280ddf65-40a2-3b4c-add5-5de39e15d8e7@fiee.net> <4794a877-7380-e1d5-b673-6770f824c7ac@xs4all.nl> <2784af61-7a02-22e4-31b7-5a63cacdf0d0@icloud.com> <8aeba37a-d6cd-eb39-6814-5756ef6ebc0c@fiee.net> In-Reply-To: <8aeba37a-d6cd-eb39-6814-5756ef6ebc0c@fiee.net> X-Proofpoint-GUID: 4neE7hxRPFjSuDOgvQV3xPbRwuRREfUD X-Proofpoint-ORIG-GUID: 4neE7hxRPFjSuDOgvQV3xPbRwuRREfUD X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.573,18.0.957,17.11.170.22.0000000_definitions?= =?UTF-8?Q?=3D2023-05-18=5F15:2023-05-17=5F02,2023-05-18=5F15,2023-02-09?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 clxscore=1015 mlxscore=0 mlxlogscore=650 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2307170158 Message-ID-Hash: VSMVC4ZXNW6XDG3GFQHFLXM5EKFMTMSY X-Message-ID-Hash: VSMVC4ZXNW6XDG3GFQHFLXM5EKFMTMSY X-MailFrom: alan.braslau@icloud.com 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.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: access image properties in Lua List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Alan Braslau via ntg-context Cc: Alan Braslau Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit On 17/07/23 17/07/23, 18:20, Henning Hraban Ramm wrote: >> Bonus question: how also to handle the case of >> \startMPcode >> draw figure "MyFigure" xsized TextWidth ; >> ... >> \stopMPcode > > Is MyFigure a pixel image? > You could use \externalfigure within MP code. The MP operator figure calls \externalfigure. However, the resolution downsampler hooked into externalfigure as you suggest would not give the desired resolutions once resized in MP. A solution might be to use draw rawtextext("\externalfigure[MyFigure][width=\textwidth") ; which is OK for this simplified example but would not work when more sophisticated MetaPost transformations might be needed. Along the lines of the conversion downsampler, a resolution reporter and manual resampling could be more efficient than reconverting the bitmap image at every run, of which there can be many. -- Alan ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________