From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79484 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 15:34:35 -0600 Message-ID: <50AFEBEB.6090107@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 1353706492 24623 80.91.229.3 (23 Nov 2012 21:34:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2012 21:34:52 +0000 (UTC) Cc: mailing list for ConTeXt users To: Sietse Brouwer Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 23 22:35:04 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 1Tc0tq-0007JO-ES for gctc-ntg-context-518@m.gmane.org; Fri, 23 Nov 2012 22:35:02 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2EDC210271; Fri, 23 Nov 2012 22:34:51 +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 PvyGlSfRNfHJ; Fri, 23 Nov 2012 22:34:48 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 77CCC10307; Fri, 23 Nov 2012 22:34:48 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 744A410307 for ; Fri, 23 Nov 2012 22:34:46 +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 haJosROWm+ad for ; Fri, 23 Nov 2012 22:34:45 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 0837110271 for ; Fri, 23 Nov 2012 22:34:45 +0100 (CET) Original-Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qANLYfBi005675 for ; Fri, 23 Nov 2012 22:34:42 +0100 Original-Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0MDY00H00MLSE400@smtpauth3.wiscmail.wisc.edu> for ntg-context@ntg.nl; Fri, 23 Nov 2012 15:34:40 -0600 (CST) Original-Received: from [192.168.1.68] (99-126-177-23.lightspeed.mdsnwi.sbcglobal.net [99.126.177.23]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MDY00H2PMLM7000@smtpauth3.wiscmail.wisc.edu> for ntg-context@ntg.nl; Fri, 23 Nov 2012 15:34:36 -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.211816, 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.212; 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: 0QIr9yG6W - c9939728c587 - 20121123 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:79484 Archived-At: Sietse, I have confirmed, after significant testing, that 'convert -density 72' against existing non-png images produces the expected results in context output pdf documents. But I'm left with another problem, again something that becomes apparent as the difference between having two output formats in my document workflow: markdown -> pandoc -> html/text -> context tex -> pdf. This time it's images that are too wide for the available textarea in the pdf document. Now that the dpi is set, they display at the expected full resolution, yet if they are greater than 6.5*72=438 pixels, they go over the right margin. I know I can, individually, modify each /externalfigure directive and add 'width=\textwidth', but that really is a PITA. This document will have close to a hundred images. I will investigate using a commandline script, exif data, and convert to work through all of the images in the folder to scale/resize them so that they fit in the PDF document margin width. I don't think that the html version will suffer if I do this. So, again, thanks for your help! Best regards, Guy S. 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 ___________________________________________________________________________________