From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/35500 Path: news.gmane.org!not-for-mail From: "Brian R. Landy" Newsgroups: gmane.comp.tex.context Subject: Re: factor=fit images don't fit Date: Sat, 21 Jul 2007 16:30:27 -0400 Message-ID: References: <10310609774.20070720012314@iol.it> <1912359178.20070720130501@iol.it> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1185049937 2669 80.91.229.12 (21 Jul 2007 20:32:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2007 20:32:17 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Jul 21 22:32:14 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1ICLcW-0005ZT-I9 for gctc-ntg-context-518@m.gmane.org; Sat, 21 Jul 2007 22:32:08 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9DB1720067; Sat, 21 Jul 2007 22:32:06 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13237-02-2; Sat, 21 Jul 2007 22:31:58 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7AF7A2004C; Sat, 21 Jul 2007 22:31:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 60D0020041 for ; Sat, 21 Jul 2007 22:31:57 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13237-02 for ; Sat, 21 Jul 2007 22:31:55 +0200 (CEST) Original-Received: from smtp137.iad.emailsrvr.com (smtp137.iad.emailsrvr.com [207.97.245.137]) by ronja.ntg.nl (Postfix) with ESMTP id 352F220057 for ; Sat, 21 Jul 2007 22:30:39 +0200 (CEST) Original-Received: by relay3.r3.iad.emailsrvr.com (Authenticated sender: brlandy-AT-landy.cx) with ESMTP id 6D10144C00D for ; Sat, 21 Jul 2007 16:30:38 -0400 (EDT) Original-Received: from [192.168.170.20] (landlord.landy.cx [192.168.170.20]) by serenity.landy.cx (Postfix) with ESMTP id CD48EC5E126C for ; Sat, 21 Jul 2007 16:30:37 -0400 (EDT) In-Reply-To: <1912359178.20070720130501@iol.it> X-Priority: 3 (Normal) X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:35500 Archived-At: Hi, What version of ConTeXt are you using? I just noticed a difference a few days ago between the version installed by TeXLive 2007 and the April 2007 release (tested locally & through contextgarden) placing an image into a natural table, using factor=max. I'll post an example in a separate thread shortly. Regards, Brian On Jul 20, 2007, at 7:05 AM, Giuseppe Bilotta wrote: > Friday, July 20, 2007 Giuseppe Bilotta wrote: > >> Hello all, > >> I have to place a number of images into some given-size >> frames in a layer. The images should be scaled >> proportionally to fit into the frame. The code I'm working >> with is: > >> \defineframed[framedimg][ >> frame=on,framecolor=elux, >> background=color, >> backgroundcolor=white, >> width=\wdfig, >> height=\htfigone, >> offset=overlay, >> ] > >> \setlayer[figs][voffset=\nextfigvoff]{% >> \framedimg{% >> \externalfigure[#1][ >> factor=fit, >> % maxwidth=\wdfig, >> % maxheight=\htfigone, >> % frame=on, >> ]% >> }% >> }% > >> where \wdfig, \htfigone are the frame size and \nextfigvoff >> is the vertical offset which must be placed. I've tried >> factor=fit, factor=max, but in both cases I get images which >> cross the boundaries of the frame, mostly in the horizontal >> direction. If I add the maxwidth/maxheight specification, >> images don't get scaled at all. > >> I would expect factor=fit to scale the image in such a way >> that the biggest direction fits into the enclosing box, >> while factor=max would scale the image in such a way that >> the smallest direction fits into the enclosing box. Instead, >> in both cases the vertical direction is being fitted, with >> no apparent consideration for the horizontal direction. > >> What am I doing wrong and what should I do to fix it? > > Ok, I've tried studying the source and I really think that > the way factor scaling is computed is wrong. However, the > fix is nontrivial, and a somewhat thorough checking should > be implemented, with earlier check for the factor value > (fit, max, broad), since the logic selecting which dimension > to scale depends on the kind of scaling. > > Anyway, I've found a temporary solutin to my problem by > using a very large value of scale=, coupled with appropriate > maxwidth and maxheight values. > > -- > Giuseppe "Oblomov" Bilotta > > ______________________________________________________________________ > _____________ > 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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ______________________________________________________________________ > _____________ > ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________