ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Brian R. Landy" <landy@alumni.caltech.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: factor=fit images don't fit
Date: Sat, 21 Jul 2007 16:30:27 -0400	[thread overview]
Message-ID: <D5D6B19B-5D2D-4EB8-89F8-E5F73319574D@alumni.caltech.edu> (raw)
In-Reply-To: <1912359178.20070720130501@iol.it>

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
___________________________________________________________________________________


  reply	other threads:[~2007-07-21 20:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 23:23 Giuseppe Bilotta
2007-07-20 11:05 ` Giuseppe Bilotta
2007-07-21 20:30   ` Brian R. Landy [this message]
2007-07-22  8:15     ` Giuseppe Bilotta
2007-07-22 20:47   ` Hans Hagen
2007-07-23  7:33     ` luigi scarso
2007-07-24  6:58       ` Giuseppe Bilotta
2007-07-24  7:27     ` Giuseppe Bilotta
2007-07-24  7:54       ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D5D6B19B-5D2D-4EB8-89F8-E5F73319574D@alumni.caltech.edu \
    --to=landy@alumni.caltech.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).