Re: how to scale down image using ImageMagick?

From: Date: Fri, 20 Apr 2001 00:16:33 +0000
Subject: Re: how to scale down image using ImageMagick?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-49456@lists.php.net to get a copy of this message
I just created a class that gets info resizes and stamps an image with text. It's pretty simple, but works. If anyone wants it email me privately. --Joe On Wed, Apr 18, 2001 at 06:00:38PM -0400, Morgan Curley wrote: > according to the docs use > -geometry 175x175> picture.jpeg > > man mogrify: > -geometry <width>x<height>{+-}<x offset>{+-}<y > offset>{%}{!}{<}{>} > preferred width and height of the image. See X(1) for > details about the geometry specification. > > By default, the width and height are maximum values. That > is, the image is expanded or contracted to > fit the width and height value while maintaining the aspect > ratio of the image. Append an exclamation > point to the geometry to force the image size to exactly the > size you specify. For example, if you > specify 640x480! the image width is set to 640 pixels and > height to 480. If only one factor is speci­ > fied, both the width and height assume the value. > > To specify a percentage width or height instead, append > %. The image size is multiplied by the width > and height percentages to obtain the final image > dimensions. To increase the size of an image, use a > value greater than 100 (e.g. 125%). To decrease an image's > size, use a percentage less than 100. > > Use > to change the dimensions of the image only if its size > exceeds the geometry specification. < > resizes the image only if its dimensions is less than the > geometry specification. For example, if you > specify 640x480> and the image size is 512x512, the image > size does not change. However, if the image > is 1024x1024, it is resized to 640x480. > > it looks like mogrify bases its resizing on the first value that is diff > than the one supplied i.e. if your image is 200x50 it will scale it to > 175x? but if it is 50x200 it will scale it to ?x175 > > if it is important you not resize based on height use identify to get the > geometry first. > > morgan > > > At 04:27 PM 4/18/2001, Noah Spitzer-Williams wrote: > >I have a bunch of pictures all in ranging filesizes and dimensions. I want > >to resize the ones that over 175 pixels wide to a 175 pixel wide picture > >however i want the height to scale down (ie. i dont want a really thin > >picture, i just want it to be what it would be if it were resized). i have > >this but i cant figure out how to just scale down the width: > > > >c:\progra~1\imagem~1\mogrify.exe -geometry 175x30! picture.jpeg > > > >the '!' forces those sizes to be used but obvoiusly i dont want the height > >to be 30. i want it to be whatever it should be so the picture doesnt look > >flattened. > > > >Thanks! - Noah > > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > >For additional commands, e-mail: php-general-help@lists.php.net > >To contact the list administrators, e-mail: php-list-admin@lists.php.net /* Joe Stump * Sr. PHP Developer * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net */

« previous php.general (#49456) next »