Re: how to scale down image using ImageMagick?
| From: | Morgan Curley | Date: | Thu, 19 Apr 2001 14:20:48 +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-49374@lists.php.net to get a copy of this message | ||
Yeah, it is unfortunate that ImageMagick uses those chars since they have other meanings on the cmd line.
just escape it ( \> ) and that should work ( works on a linux box )
morgan
At 07:53 PM 4/18/2001, you wrote:
morgan,this is starting to work! the 175x175 does resize it to a width of 175while retaining the aspect ratio.however.... when i tried using the less than sign, the windows ntcommand 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 ----- Original Message ----- From: "Morgan Curley" <mcurley@e4media.com> Newsgroups: php.general Sent: Wednesday, April 18, 2001 5:55 PM Subject: Re: [PHP] how to scale down image using ImageMagick? 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) fordetails about the geometry specification.By default, the width and height are maximum values. Thatis, the image is expanded or contracted tofit the width and height value while maintaining the aspectratio of the image. Append an exclamationpoint to the geometry to force the image size to exactly thesize you specify. For example, if youspecify 640x480! the image width is set to 640 pixels andheight to 480. If only one factor is specified, both the width and height assume the value.To specify a percentage width or height instead, append%. The image size is multiplied by the widthand height percentages to obtain the final imagedimensions. To increase the size of an image, use avalue greater than 100 (e.g. 125%). To decrease an image'ssize, use a percentage less than 100.Use > to change the dimensions of the image only if its sizeexceeds the geometry specification. <resizes the image only if its dimensions is less than thegeometry specification. For example, if youspecify 640x480> and the image size is 512x512, the imagesize does not change. However, if the imageis 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