Re: [PHP] how to scale down image using ImageMagick?
"Noah Spitzer-Williams" [EMAIL PROTECTED] 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. I believe imagemagick has an option where you can specify a single dimension (x or y) and it will set that dimension accordingly and automatically scale the other dimension. This should be covered in the manual pages or --help output of the program. -- -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
Is there a way to install the GD library on windows nt systems? i can't get this thing to not scale it if its smaller than a certain width ""Steve Werby"" [EMAIL PROTECTED] wrote in message 00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7... "Noah Spitzer-Williams" [EMAIL PROTECTED] 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. I believe imagemagick has an option where you can specify a single dimension (x or y) and it will set that dimension accordingly and automatically scale the other dimension. This should be covered in the manual pages or --help output of the program. -- -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
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 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 - Original Message - From: "Morgan Curley" [EMAIL PROTECTED] 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 widthxheight{+-}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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
I use ImageMagik all the time for thumbnail creations... this doesn't resize the image, it creates a new image, a thumbnail... but the principle is the same $cWidth = 175; $picture_src = "fullSize/somepic.jpg"; $thumb_dest = "fthumbNail/somepic.jpg"; $aImageInfo = getimagesize( $picture_src ); if( $aImageInfo[0] $cWidth ) { exec("convert -geometry $cWidth -colors 256 -colorspace yuv $picture_src $thumb_dest" ); } At 08:59 AM 4/19/01 -0400, Noah Spitzer-Williams wrote: Is there a way to install the GD library on windows nt systems? i can't get this thing to not scale it if its smaller than a certain width ""Steve Werby"" [EMAIL PROTECTED] wrote in message 00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7... "Noah Spitzer-Williams" [EMAIL PROTECTED] 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. I believe imagemagick has an option where you can specify a single dimension (x or y) and it will set that dimension accordingly and automatically scale the other dimension. This should be covered in the manual pages or --help output of the program. -- -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
Hi! This is what I do: if (!empty($picture)) { $size = GetImageSize ("pics/$picture"); if ($size[0] = '175') { $width = '175'; $height = $size[1] * ($width / $size[0]); } else { $width = $size[0]; $height = $size[1]; } } echo "img src=\"pics\$picture\" height=\"$height\" width=\"$width\""; Fredrik A. Takle Bergen, Norway ""Joe Sheble (Wizaerd)"" [EMAIL PROTECTED] skrev i melding [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I use ImageMagik all the time for thumbnail creations... this doesn't resize the image, it creates a new image, a thumbnail... but the principle is the same $cWidth = 175; $picture_src = "fullSize/somepic.jpg"; $thumb_dest = "fthumbNail/somepic.jpg"; $aImageInfo = getimagesize( $picture_src ); if( $aImageInfo[0] $cWidth ) { exec("convert -geometry $cWidth -colors 256 -colorspace yuv $picture_src $thumb_dest" ); } At 08:59 AM 4/19/01 -0400, Noah Spitzer-Williams wrote: Is there a way to install the GD library on windows nt systems? i can't get this thing to not scale it if its smaller than a certain width ""Steve Werby"" [EMAIL PROTECTED] wrote in message 00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7... "Noah Spitzer-Williams" [EMAIL PROTECTED] 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. I believe imagemagick has an option where you can specify a single dimension (x or y) and it will set that dimension accordingly and automatically scale the other dimension. This should be covered in the manual pages or --help output of the program. -- -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
This is a neat bit of code to fill in image height and width info but it does not affect the actual file size like resizing the image would morgan At 02:43 PM 4/19/2001, FredrikAT wrote: Hi! This is what I do: if (!empty($picture)) { $size = GetImageSize ("pics/$picture"); if ($size[0] = '175') { $width = '175'; $height = $size[1] * ($width / $size[0]); } else { $width = $size[0]; $height = $size[1]; } } echo "img src=\"pics\$picture\" height=\"$height\" width=\"$width\""; Fredrik A. Takle Bergen, Norway ""Joe Sheble (Wizaerd)"" [EMAIL PROTECTED] skrev i melding [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I use ImageMagik all the time for thumbnail creations... this doesn't resize the image, it creates a new image, a thumbnail... but the principle is the same $cWidth = 175; $picture_src = "fullSize/somepic.jpg"; $thumb_dest = "fthumbNail/somepic.jpg"; $aImageInfo = getimagesize( $picture_src ); if( $aImageInfo[0] $cWidth ) { exec("convert -geometry $cWidth -colors 256 -colorspace yuv $picture_src $thumb_dest" ); } At 08:59 AM 4/19/01 -0400, Noah Spitzer-Williams wrote: Is there a way to install the GD library on windows nt systems? i can't get this thing to not scale it if its smaller than a certain width ""Steve Werby"" [EMAIL PROTECTED] wrote in message 00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7... "Noah Spitzer-Williams" [EMAIL PROTECTED] 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. I believe imagemagick has an option where you can specify a single dimension (x or y) and it will set that dimension accordingly and automatically scale the other dimension. This should be covered in the manual pages or --help output of the program. -- -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
right my goal was to actually alter the file size for quicker downloads and less bandwidth. the solution was a combination of morgan's and joe's posts. thansk guys! - Noah "Morgan Curley" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... This is a neat bit of code to fill in image height and width info but it does not affect the actual file size like resizing the image would morgan At 02:43 PM 4/19/2001, FredrikAT wrote: Hi! This is what I do: if (!empty($picture)) { $size = GetImageSize ("pics/$picture"); if ($size[0] = '175') { $width = '175'; $height = $size[1] * ($width / $size[0]); } else { $width = $size[0]; $height = $size[1]; } } echo "img src=\"pics\$picture\" height=\"$height\" width=\"$width\""; Fredrik A. Takle Bergen, Norway ""Joe Sheble (Wizaerd)"" [EMAIL PROTECTED] skrev i melding [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I use ImageMagik all the time for thumbnail creations... this doesn't resize the image, it creates a new image, a thumbnail... but the principle is the same $cWidth = 175; $picture_src = "fullSize/somepic.jpg"; $thumb_dest = "fthumbNail/somepic.jpg"; $aImageInfo = getimagesize( $picture_src ); if( $aImageInfo[0] $cWidth ) { exec("convert -geometry $cWidth -colors 256 -colorspace yuv $picture_src $thumb_dest" ); } At 08:59 AM 4/19/01 -0400, Noah Spitzer-Williams wrote: Is there a way to install the GD library on windows nt systems? i can't get this thing to not scale it if its smaller than a certain width ""Steve Werby"" [EMAIL PROTECTED] wrote in message 00ae01c0c848$8a802bb0$6501a8c0@workstation7">news:00ae01c0c848$8a802bb0$6501a8c0@workstation7... "Noah Spitzer-Williams" [EMAIL PROTECTED] 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. I believe imagemagick has an option where you can specify a single dimension (x or y) and it will set that dimension accordingly and automatically scale the other dimension. This should be covered in the manual pages or --help output of the program. -- -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
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 widthxheight{+-}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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] /* Joe Stump * Sr. PHP Developer * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how to scale down image using ImageMagick?
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how to scale down image using ImageMagick?
according to the docs use -geometry 175x175 picture.jpeg man mogrify: -geometry widthxheight{+-}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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]