What I found works very well for this is the function:
getimagesize();

$image_file = "something.jpg";
$size = getimagesize($image_file);
//$size[0] = height and $size[1] = width (double check on php.net)

//Then just divide them...
$width = $size[1]/2;
$height=$size[0]/2;

<DISPLAY IMAHE height=$height width=$width>

This way it will keep the original deminsions of the photo, just cut it in 
half, or however much you want to cut it down.  Of course this approach makes 
viewing eaiser, but does not really cut down on the download time of the JPG, 
so if that is your primary concern, then another approach may be in order?

HTH
-Brad

> I sent this email out earlier this morning and got no response. It was quite
> early so I thought I would send it again now that more people are hopefully
> at work :-)
> 
>  
> 
>  
> 
> I have been trying to figure out the best way to resize photo quality images
> to thumbnail size and have them come out looking good. I have read about the
> function " <http://www.php.net/manual/en/function.imagecreatetruecolor.php
> <http://www.php.net/manual/en/function.imagecreatetruecolor.php> >
> 
> imagecreatetruecolor()" and it looks like it may do this. However I do not
> have GD 2 installed which is required for this function to work. In the
> process of trying to figure out how to install GD v2 I came across the
> following page. 
> 
>  
> 
> http://www.php.net/manual/en/ref.image.php
> <http://www.php.net/manual/en/ref.image.php> 
> 
> <http://www.php.net/manual/en/ref.image.php
> <http://www.php.net/manual/en/ref.image.php> > 
> 
>  
> 
> On this page is says;
> 
>  
> 
>  
> 
>  
> 
>  "Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled
> version has some additional features like alpha blending and should be used
> in preference to the external library since it's codebase is better
> maintained and more stable."
> 
>  
> 
>  
> 
>  
> 
> I thought the most recent version of php was 4.2.2? 
> 
>  
> 
>  
> 
>  
> 
> Anyway if there is a better way to resize images to create "high quality"
> thumbnails I would love to hear about it. I am on a redhat 7.3 server and
> not very familiar with linux. I would prefer not to have to take the time
> involved in learning how to install new packages right now, but realize this
> may be unavoidable. 
> 
>  
> 
>  
> 
>  
> 
> Thanks in advance for any help.
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to