ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <gip.bilotta@iol.it>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: factor=fit images don't fit
Date: Tue, 24 Jul 2007 09:27:16 +0200	[thread overview]
Message-ID: <304705957.20070724092716@iol.it> (raw)
In-Reply-To: <46A3C247.6050109@wxs.nl>

Sunday, July 22, 2007 Hans Hagen wrote:

> the fit assumes operating on a page not in a box;

Ah, didn't know that. I couldn't even tell from the sources,
since it uses enclosing box dimensions and not page or paper
sizes. I suspect the logic is broken at the page level too
though, let me explain why.

Currently, if I understand the code correctly, factor=fit
expands the figure to have its major direction fit, while
factor=max expands the figure to have its minor direction
fit.

Instead, the behavior I would expect from fit (resp. max) is
for the *expansion ratio* to be the minimum (resp. maximum)
of the expansion ratios in the two directions (not the sizes
in those directions, but the ratio between the sizes of the
figure and the container). The difference is noticeable when
the container and contained have different aspect ratios.

Consider for example a 20x30mm figure in a 50x150mm page
(strange numbers, just used to show what I mean): with the
current code, using 'fit' would consider the largest
dimension (30) and thus calculate a factor of 150/30 = 5,
but this gives us an image which is 100x150mm, i.e. an image
that doesn't fit! Whereas, if we computed the ratios 50/20 =
2.5 and 150/30 = 5, we would know that the ratio to be
picked was 2.5 in 'fit' and 5 in 'max'.

Or I misintepreting the meaning of 'fit' and 'max'?

>  an alternative is:

> \framed[width=5cm,height4cm]
>   
> {\externalfigure[mill.png][maxwidth=4cm,maxheight=5cm,width=10cm]}

> i.e. setting the maximum values

I hadn't thought about using width and maxwidth (and
maxheight) at the same time, thanks. Of course, I'd rather
have 'fit' and 'max' usable in boxes :)

-- 
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
___________________________________________________________________________________


  parent reply	other threads:[~2007-07-24  7:27 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
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 [this message]
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=304705957.20070724092716@iol.it \
    --to=gip.bilotta@iol.it \
    --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).