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]