From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79492 Path: news.gmane.org!not-for-mail From: Guy Stalnaker Newsgroups: gmane.comp.tex.context Subject: Re: Images in MultiMarkdown -> context -> PDF Date: Fri, 23 Nov 2012 17:25:56 -0600 Message-ID: <50B00604.30103@wisc.edu> References: <50AC5BB4.4010205@wisc.edu> <1F8187F3-69EF-4DA3-8150-D6682B92E595@wisc.edu> <50AD1AAA.1040302@wisc.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1353713166 10470 80.91.229.3 (23 Nov 2012 23:26:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2012 23:26:06 +0000 (UTC) Cc: mailing list for ConTeXt users To: Sietse Brouwer Original-X-From: ntg-context-bounces@ntg.nl Sat Nov 24 00:26:18 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tc2dV-0003G5-91 for gctc-ntg-context-518@m.gmane.org; Sat, 24 Nov 2012 00:26:17 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F21EC1038C; Sat, 24 Nov 2012 00:26:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tRAo+pdwgcJN; Sat, 24 Nov 2012 00:26:03 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 939FD1032A; Sat, 24 Nov 2012 00:26:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BB2C21032A for ; Sat, 24 Nov 2012 00:26:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nPzg1MMF2uOI for ; Sat, 24 Nov 2012 00:26:00 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id A0BC81031D for ; Sat, 24 Nov 2012 00:26:00 +0100 (CET) Original-Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qANNPwGC004300 for ; Sat, 24 Nov 2012 00:25:59 +0100 Original-Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0MDY00900RR99M00@smtpauth2.wiscmail.wisc.edu> for ntg-context@ntg.nl; Fri, 23 Nov 2012 17:25:57 -0600 (CST) Original-Received: from [192.168.1.68] (99-126-177-23.lightspeed.mdsnwi.sbcglobal.net [99.126.177.23]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MDY006VBRR7MB00@smtpauth2.wiscmail.wisc.edu> for ntg-context@ntg.nl; Fri, 23 Nov 2012 17:25:56 -0600 (CST) In-reply-to: X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.11.23.231517, SenderIP=192.168.1.68 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=144.92.197.211; country=US; region=WI; city=Madison; postalcode=53706; latitude=43.0761; longitude=-89.4104; metrocode=669; areacode=608; http://maps.google.com/maps?q=43.0761,-89.4104&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TIrbpWFI - adcb544cd599 - 20121124 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79492 Archived-At: In case anyone else has been following this thread, here is the shell script I wrote to resize an image width to 6.5x72dpi so they fit in the standard letter pagesize \textwidth with 1-inch margins and add image density/resolution information so that context correctly sizes them in the PDF output file. #!/bin/bash #set -x TEXTWIDTH="438" #6.5inches x 72 dpi for i in *.jpg ; do SIZEX="$(exiftool -imagewidth $i | awk '{print $4}')" SIZEY="$(exiftool -imageheight $i | awk '{print $4}')" echo "Image $i is $SIZEX x $SIZEY, max X is $TEXTWIDTH ..." if [[ $SIZEX > $TEXTWIDTH ]] ; then convert $i -resize $TEXTWIDTH -density 72 $i echo "resized image $i from $SIZEX to $TEXTWIDTH." fi done Regards, Guy On 11/21/2012 02:36 PM, Sietse Brouwer wrote: > Guy wrote: >> Well, that lead to an interesting experiment. I used convert to -resample a >> set of images to 300dpi and redid the compile. They are all now too bod, >> many off the right side of the page. Then did the same but set to 72. They >> are still too big. Odd, from too small to too big. > I think you don't want -resample, but -density: > > # density given in dpi > convert pic.jpg -density 72 pic-out.jpg > > convert -density keeps the pixel size and changes the display size by > setting the density metadata. > convert -resample keeps the display size and changes the pixel size by > resampling at a certain density. (This explains why the picture > remained the same too-large size when you resampled at 72 and 300 > dpi.) > > Because you want to change the display size (and also because > resampling is a lossy process), I think you want -density. > > As for the density value you want to use: > Your picture is 547px wide, so if you want it to display it 3 inches > wide you should set its density metadata to 547/3 = 183 dpi. > > Does this work? > All the best, > Sietse -- "There is only love, and then oblivion. Love is all we have to set against hatred." (paraphrased) Ian McEwan Guy Stalnaker, I^2@DOIT, 1210 West Dayton Street, Room 3209 CSS, Madison WI 53719-1220, jstalnak@wisc.edu, work 608.263.8035, cell 608.235.4718, fax 608.265.6681, page page-guy@watchdog.doit.wisc.edu ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________