* external figure sizing
@ 2015-05-09 20:26 Csikos Bela
2015-05-09 21:07 ` Hans Hagen
2015-05-09 21:08 ` Peter Münster
0 siblings, 2 replies; 4+ messages in thread
From: Csikos Bela @ 2015-05-09 20:26 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hello list members:
I would like to make a photo montage (4x3 images on one page) using
\placefigure, \externalfigure and combinations. The images should be scaled to the
same size, eg to .25\textwith and .3\textheight so that the aspect ratios of the images
are kept and the appropriate value is used for width or height. That is the smaller value
from .25\textwith and .3\textheight is used for the image size.
Using only \useexternalfigure[Fig1][1.jpg][width=.25\textwidth] may not give the correct
result if the image requires size adjustment by height and vice versa. Defining both
width and height results in exact resizing and the aspect ratio is not maintained.
How can this be solved?
Thanks,
bcsikos
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: external figure sizing
2015-05-09 20:26 external figure sizing Csikos Bela
@ 2015-05-09 21:07 ` Hans Hagen
2015-05-09 21:08 ` Peter Münster
1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2015-05-09 21:07 UTC (permalink / raw)
To: ntg-context
On 5/9/2015 10:26 PM, Csikos Bela wrote:
> Hello list members:
>
> I would like to make a photo montage (4x3 images on one page) using
> \placefigure, \externalfigure and combinations. The images should be scaled to the
> same size, eg to .25\textwith and .3\textheight so that the aspect ratios of the images
> are kept and the appropriate value is used for width or height. That is the smaller value
> from .25\textwith and .3\textheight is used for the image size.
>
> Using only \useexternalfigure[Fig1][1.jpg][width=.25\textwidth] may not give the correct
> result if the image requires size adjustment by height and vice versa. Defining both
> width and height results in exact resizing and the aspect ratio is not maintained.
>
> How can this be solved?
\useMPlibrary[dum]
\showframe
\starttext
\setuplayout[middle]
\defineexternalfigure[quarter][factor=max]
\vbox{\dorecurse{4}{\hbox{\hsize.25\textwidth\vsize.25\textheight\dorecurse{4}{\externalfigure[dummy][quarter]}}}}
\page
\setuppapersize[A4,landscape] \setuplayout[middle]
\vbox{\dorecurse{4}{\hbox{\hsize.25\textwidth\vsize.25\textheight\dorecurse{4}{\externalfigure[dummy][quarter]}}}}
\stoptext
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: external figure sizing
2015-05-09 20:26 external figure sizing Csikos Bela
2015-05-09 21:07 ` Hans Hagen
@ 2015-05-09 21:08 ` Peter Münster
2015-05-11 15:27 ` Csikos Bela
1 sibling, 1 reply; 4+ messages in thread
From: Peter Münster @ 2015-05-09 21:08 UTC (permalink / raw)
To: ntg-context
On Sat, May 09 2015, Csikos Bela wrote:
> \placefigure, \externalfigure and combinations. The images should be scaled to the
> same size, eg to .25\textwith and .3\textheight so that the aspect ratios of the images
> are kept and the appropriate value is used for width or height.
What is the "appropriate" value?
> That is the smaller value from .25\textwith and .3\textheight is used
> for the image size.
"The smaller value from .25\textwith and .3\textheight" does only depend
on the layout, but not on the image.
This is perhaps, what you need: maxwidth=..., maxheight=...
--
Peter
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: external figure sizing
2015-05-09 21:08 ` Peter Münster
@ 2015-05-11 15:27 ` Csikos Bela
0 siblings, 0 replies; 4+ messages in thread
From: Csikos Bela @ 2015-05-11 15:27 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Peter Münster
"Peter Münster" írta:
>On Sat, May 09 2015, Csikos Bela wrote:
>
>> \placefigure, \externalfigure and combinations. The images should be scaled to the
>> same size, eg to .25\textwith and .3\textheight so that the aspect ratios of the images
>> are kept and the appropriate value is used for width or height.
>
>What is the "appropriate" value?
The calculated value which pairs with < or = to the other calculated value.
For example if the height calculated for .25\textwidth is less than .3\textheight
then .25\textwidth else .3\textheight should be used for calculating the size of
the image.
>> That is the smaller value from .25\textwith and .3\textheight is used
>> for the image size.
>
>"The smaller value from .25\textwith and .3\textheight" does only depend
>on the layout, but not on the image.
Of course, but the layout determines how the images has to be scaled.
>This is perhaps, what you need: maxwidth=..., maxheight=...
Exactly, this is what I need.
Thanks,
bcsikos
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-11 15:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09 20:26 external figure sizing Csikos Bela
2015-05-09 21:07 ` Hans Hagen
2015-05-09 21:08 ` Peter Münster
2015-05-11 15:27 ` Csikos Bela
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).