Ask a Question related to PHP Development, Design and Development.
-
Ralph Freshour #1
Images and Aspect Ratio Help Needed
I'm trying to figure out how to write some php code that will allow me
to resize a .jpg image and maintain it's aspect ratio - any help or
idea's would be appreciated.
Thanks...
Ralph Freshour Guest
-
Resize Imges maintaining aspect ratio
I want to do a page like web photo album. I want to show some thumbnails and when i click on it, it should open the image with the original size!... -
constrain aspect ratio
Hi. FH MX User 1.When I want to change the size of my object (w or h) here a logo on object panel,( even when I check "transform as unit" ) it... -
Locking aspect ratio to 4x3 NOT 16x9
Hi. I have developed a swf presentation at 4x3 ratio. Now it will be shown on a 16x9 machine and everything is stretched. Is their a way with code I... -
Resizing Movies to fit res...but keeping aspect ratio.
OK...I've looked for this soultion around but I havent found it. Basically I have a page with flash (www.madisyn.com , click on "knight" image,... -
wntd: true 8/10 ,5/7 pictures , despite aspect ratio ?
Hi, I don't know about the software you are using but in Photoshop Elements 2 you can set the dimensions of the crop tool to whatever you want... -
Steven Musumeche #2
Re: Images and Aspect Ratio Help Needed
function thumbnail($image_path,$thumb_path,$image_name,$thu mb_width)
{
$src_img = imagecreatefromjpeg("$image_path/$image_name");
$origw=imagesx($src_img);
$origh=imagesy($src_img);
if ($origw>$origh)
{
$new_w = $thumb_width;
$diff=$new_w/$origw;
$new_h=$origh*$diff;
}
else
{
$new_h = $thumb_width;
$diff=$new_h/$origh;
$new_w=$origw*$diff;
}
$dst_img = imagecreatetruecolor($new_w,$new_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_ w,$new_h,imagesx($src_img)
,imagesy($src_img));
imagejpeg($dst_img, "$thumb_path/th_$image_name");
return true;
}
"Ralph Freshour" <ralph@primemail.com> wrote in message
news:nsttqvs5ft6evj2s2p3dkau5kdq9rklres@4ax.com...> I'm trying to figure out how to write some php code that will allow me
> to resize a .jpg image and maintain it's aspect ratio - any help or
> idea's would be appreciated.
>
> Thanks...
>
Steven Musumeche Guest



Reply With Quote

