Autor | Zpráva | ||
---|---|---|---|
hehe123 Profil * |
#1 · Zasláno: 9. 10. 2007, 18:47:11
function resizeImage($filename, $newwidth, $newheight)
{ list($width, $height) = getimagesize($filename); if($width > $height && $newheight < $height){ $newheight = $height / ($width / $newwidth); } else if ($width < $height && $newwidth < $width) { $newwidth = $width / ($height / $newheight); } else { $newwidth = $width; $newheight = $height; } $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); return imagepng($thumb); } |
||
hehe123 Profil * |
#2 · Zasláno: 9. 10. 2007, 18:52:20
Dotaz je taky aby mi to dokazalo zmensit aj fotky ktore su GIF, PNG..co tam mam pridat?
|
||
nightfish Profil |
#3 · Zasláno: 9. 10. 2007, 18:55:44
$source = imagecreatefromjpeg($filename);
tenhle řádek musí nabývat různých podob pro různé formáty fotek ke zjištění formátu fotky pomůže funkce getimagesize() |
||
hehe123 Profil * |
#4 · Zasláno: 9. 10. 2007, 19:30:04
a nenapisal by mi to niekto??
|
||
Kcko Profil |
#5 · Zasláno: 10. 10. 2007, 00:03:20
Ne
staci ti toto getImageSize Switch prisluna fce pro dany mime typ |
||
Časová prodleva: 17 let
|
0