Re: how to scale down image using ImageMagick?

From: Date: Thu, 19 Apr 2001 18:43:53 +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-49395@lists.php.net to get a copy of this message
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)"" <JustForMailingLists@wizaerd.com> skrev i melding news:5.0.2.1.0.20010419072017.00a75470@mail.wizaerd.com... > > 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"" <steve-lists@befriend.com> wrote in message > >news:00ae01c0c848$8a802bb0$6501a8c0@workstation7... > > > "Noah Spitzer-Williams" <noahsw@cyberdude.com> 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: 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 > > > > > > > > > > >-- > >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 > > > -- > 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 (#49395) next »