From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/103349 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Henning Hraban Ramm Newsgroups: gmane.comp.tex.context Subject: Re: degrade module Date: Fri, 15 Feb 2019 08:24:50 +0100 Message-ID: <34275BF1-3CCF-4E06-8BB5-7E23A361345C@fiee.net> References: <87lg2ikt6e.fsf@a16n.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_75FD4FD9-5587-497C-B60E-539B651A4546" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="241914"; mail-complaints-to="usenet@blaine.gmane.org" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 15 08:25:13 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1guXrz-0010jR-4g for gctc-ntg-context-518@m.gmane.org; Fri, 15 Feb 2019 08:25:11 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9DC54EC693; Fri, 15 Feb 2019 08:24:51 +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 zLNNO7VaSf0W; Fri, 15 Feb 2019 08:24:50 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E7AC8EC689; Fri, 15 Feb 2019 08:24:50 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 49381EC689 for ; Fri, 15 Feb 2019 08:24:49 +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 Tq-3_NrEuLJV for ; Fri, 15 Feb 2019 08:24:48 +0100 (CET) Original-Received: from fiee.net (feronia.fiee.net [46.163.112.221]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 5119DEC686 for ; Fri, 15 Feb 2019 08:24:48 +0100 (CET) Original-Received: from [192.168.178.165] (p5B293925.dip0.t-ipconnect.de [91.41.57.37]) by mail.fiee.net (Postfix) with ESMTPSA id 563D78030E for ; Fri, 15 Feb 2019 08:24:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fiee.net; s=default; t=1550215488; bh=Io2buf+lck9PY3Xo9fY6LTqTI/+rWeFNt4c0KiiUe9k=; l=3431; h=From:Subject:To; b=AJl/1/JCse2obWc+8jf49HjIocXvYqBf4gEjVFZrMxpetdyT4802cm4+xUd+0PYAp ECzvVV/gWyzITeygZfPcYaP5jHf6UftLz60Ynea4nqpl28AVHOtsCWZmn7Gg2q30FZ lyYJlhwE0uLBzqa15ClOCssS8IFpERUb++N6i99E= Authentication-Results: feronia.fiee.net; spf=pass (sender IP is 91.41.57.37) smtp.mailfrom=texml@fiee.net smtp.helo=[192.168.178.165] Received-SPF: pass (feronia.fiee.net: connection is authenticated) In-Reply-To: X-Mailer: Apple Mail (2.1878.6) 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.org gmane.comp.tex.context:103349 Archived-At: --Apple-Mail=_75FD4FD9-5587-497C-B60E-539B651A4546 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Am 2019-02-15 um 07:56 schrieb Lutz Haseloff = : > Thank you all for your help. >=20 > First i tried the grph-downsample.lua script. > Unfortunately i get an error message > grph-downsample.lua:31: bad argument #2 to 'format' (number has no = integer representation) > See attached log file. It=92s a problem due to changes in Lua between 5.2 and 5.3 (or the = like). The attached version works (for me). Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD --Apple-Mail=_75FD4FD9-5587-497C-B60E-539B651A4546 Content-Disposition: attachment; filename=grph-downsample.lua Content-Type: application/octet-stream; name="grph-downsample.lua" Content-Transfer-Encoding: quoted-printable if=20not=20modules=20then=20modules=20=3D=20{=20}=20end=20modules=20= ['grph-downsample']=20=3D=20{=0A=20=20version=20=20=20=3D=201.001,=0A=20=20= comment=20=20=20=3D=20"companion=20to=20grph-inc.mkiv",=0A=20=20author=20= =20=20=20=3D=20"Peter=20M=C3=BCnster",=0A=20=20copyright=20=3D=20"PRAGMA=20= ADE=20/=20ConTeXt=20Development=20Team",=0A=20=20license=20=20=20=3D=20= "see=20context=20related=20readme=20files"=0A}=0A=0Alocal=20format=20=3D=20= string.format=0A--=20figures.cachepaths.path=20=3D=20"cache"=20--=20= should=20be=20setup-option=0Alocal=20function=20sample_down(oldname,=20= newname,=20resolution)=0A=20=20local=20request=20=3D=20= figures.current().request=0A=20=20local=20width=20=3D=20request.width=0A=20= =20local=20height=20=3D=20request.height=0A=20=20if=20resolution=20=3D=3D=20= ""=20or=20(not=20width=20and=20not=20height)=20then=0A=20=20=20=20= print(format("Nothing=20to=20do:=20%s,=20%s,=20%s",=20oldname,=20= newname,=20resolution))=0A=20=20=20=20return=0A=20=20end=0A=20=20local=20= TEXpt=20=3D=2065536=0A=20=20local=20inch=20=3D=2072.27=0A=20=20local=20= image=20=3D=20img.scan{filename=20=3D=20oldname}=0A=20=20local=20xy=20=3D=20= image.xsize=20/=20image.ysize=0A=20=20if=20not=20width=20then=0A=20=20=20= =20width=20=3D=20height=20*=20xy=20/=20TEXpt=0A=20=20end=0A=20=20if=20= not=20height=20then=0A=20=20=20=20height=20=3D=20width=20/=20xy=20/=20= TEXpt=0A=20=20end=0A=20=20local=20xsize=20=3D=20resolution=20*=20width=20= /=20inch=0A=20=20local=20ysize=20=3D=20resolution=20*=20height=20/=20= inch=0A=20=20if=20xsize=20<=20image.xsize=20or=20ysize=20<=20image.ysize=20= then=0A=20=20=20=20local=20s=20=3D=20format("gm=20convert=20-resize=20= %dx%d=20%s=20%s",=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20xsize,=20ysize,=20oldname,=20newname)=0A=20=20=20=20= print("Conversion:=20"=20..=20s)=0A=20=20=20=20os.execute(s)=0A=20=20= else=0A=20=20=20=20print(format("Nothing=20to=20do:=20%s,=20%s,=20%s",=20= oldname,=20newname,=20resolution))=0A=20=20=20=20print(format("xsize=20=3D= =20%d,=20ysize=20=3D=20%d",=20xsize,=20ysize))=0A=20=20end=0Aend=0A=0A= local=20formats=20=3D=20{"png",=20"jpg",=20"gif"}=0A=0Afor=20_,=20s=20in=20= ipairs(formats)=20do=0A=20=20figures.converters[s]=20=3D=20= figures.converters[s]=20or=20{}=0A=20=20figures.converters[s]["lowres."=20= ..=20s]=20=3D=20sample_down=0Aend=0A= --Apple-Mail=_75FD4FD9-5587-497C-B60E-539B651A4546 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== --Apple-Mail=_75FD4FD9-5587-497C-B60E-539B651A4546--