Hi Fred,

Nope, hehe, the {} brackets aren't the problem, they convert my values
correctly. Very strange! Ok I'll take a deeper look at this tomorrow and get
back with what the issue is. Maybe something else is happening at other
parts of the script.

Will get back to you soon,

Dave

On Sun, Mar 29, 2009 at 11:43 PM, Fred Weinhaus <[email protected]> wrote:

>  Your original image is 1920x1200 NOT 1900x1200, so when I run your
> command manually as
>
> convert 768.jpg  -filter Lanczos -quality 50% -resize '1024x768>^'
> 768_tmp.jpg
>
> I get an image that is 1229x768, which is correct.
>
> I believe your problem may lie in the following misplacement of {}
>
> rather than
>
>  '{$browser[1]}x{$browser[2]}>^'
>
> try having the $ outside the {} as
>
>  '${browser[1]}x${browser[2]}>^'
>
> Fred
>
> P.S.
>
> Lanczos is the default fo resize reduction, so -filter Lanczos is not
> really necessary.
>
>
>
>
>
> Hmmm,
>
> Here's my command: convert {$file} -filter Lanczos -quality 50% -resize
> '{$browser[1]}x{$browser[2]}>^' '{$file_generated}' which accords with what
> you've suggested.
>
> My requested image size is 1024x768 and imagemagick is pumping out
> 1900x1200 for each image I try. You can play with it dynamically here:
>
> http://dev.intelligent    -    creatures.com/backgrounds/get/1097/1024/768
>
> Remove the "    -    " in the domain address. The last two slashes in the
> address represent the width and the height. The first one after get is just
> the image ID.
>
> I'm baffled. :-/
>
> Dave
>
> On Sun, Mar 29, 2009 at 8:17 PM, Fred Weinhaus <[email protected]> wrote:
>
>
> If you are reducing only and do not care about going over on one side
> or the other then use -resize 'WIDTHxHEIGHT>^`
>
> That will reduce only if the image is larger than WIDTHxHEIGHT and
> will resize according to the images smaller dimension to fit WIDTH or
> HEIGHT. The other dimension will be larger than what you specified by
> WIDTH or HEIGHT.
>
> In your case, your image has an aspect ratio of
> 1900/1200=1.58333333333 and WIDTH/HEIGHT=1024/768=1.333333333. So
> your image has a larger w to h aspect ratio than you specify in
> -resize. Thus the smaller dimension will be the height and your image
> will end up with a height of 768. Then the width will be scaled to
> 768*1.583=1216. Thus you will have an image result of 1216x768
>
>
>
> >So the question is ... how should I calculate it? Say I have a 1024x768
> >screen and my image is larger (a rectangle of say 1900x1200). I want to
> >avoid letterboxing at all costs. So basically: the new image HAS to fit
> the
> >minimum dimensions but can go over in height or width, doesn't matter
> which.
>
> _______________________________________________
> Magick-users mailing list
> [email protected]
> http://studio.imagemagick.org/mailman/listinfo/magick-users
>
>
>
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to