Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] GD, miniaturka z określoną szerokością
merdenoms
post
Post #1





Grupa: Zarejestrowani
Postów: 21
Pomógł: 0
Dołączył: 22.02.2008

Ostrzeżenie: (0%)
-----


Nie posiada ktoś przypadkiem wersji tego skryptu ale z określana szerokością a nie wysokością?

Kod
$size = getimagesize($image);
$height = 295;
if($size[1] > $height){
   $width = round($size[0] * ($height / $size[1]));
   $image_p = imagecreatetruecolor($width, $height);
   $image = imagecreatefromjpeg($image);
   imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
}else{
   $image_p = imagecreatetruecolor($size[0], $size[1]);
   $image = imagecreatefromjpeg($image);
   imagecopy($image_p, $image, 0, 0, 0, 0, $size[0], $size[1]);
}
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 16:15