Re: how to scale down image using ImageMagick?

From: Date: Wed, 18 Apr 2001 23:52:54 +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-49289@lists.php.net to get a copy of this message
morgan, this is starting to work! the 175x175 does resize it to a width of 175 while retaining the aspect ratio. however.... when i tried using the less than sign, the windows nt command prompt is treating it as saving the output to a file: c:\progra~1\imagem~1\mogrify.exe -geometry 175x175> picture.jpeg imagemagick replies with : missing image file name. this is because the > sign is telling windows to save the output to a file. i tried putting a 1 after the > sign and it made a blank file with filename of '1'. how can i get around this? i couldnt figure out how to use -identify, it was not in the docs Thanks so much! - Noah "Morgan Curley" <mcurley@e4media.com> wrote in message news:4.3.2.7.2.20010418173029.025a6cd8@e4media.com... 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

« previous php.general (#49289) next »