![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 788 Pomógł: 1 Dołączył: 17.09.2004 Ostrzeżenie: (10%) ![]() ![]() |
Witam serdecznie,
Potrzebuję zrobić generator miniaturek w PHP. chciałbym skryptem nakładać zrobioną już miniaturkę na pusty kwadrat i łączysz w jeden obrazek. (chce uzyskać w galerii jednakową wielkość miniaturek) Wie ktoś może jak to ugryźć? Łukasz |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 788 Pomógł: 1 Dołączył: 17.09.2004 Ostrzeżenie: (10%) ![]() ![]() |
super dzięki (IMG:style_emoticons/default/smile.gif)
ps. znalazłem jeszcze taką funkcję: Kod function generateThumbnail($fname, $thwidth, $thheight, $fnname) { $src = imagecreatefromjpeg($fname); list($imgwidth,$imgheight)=getimagesize($fname); $imgratio = $imgwidth / $imgheight; $thratio = $thwidth / $thheight; if ($imgratio < $thratio) { $newwidth = $thheight * $imgratio; $offsetx = ($thwidth - $newwidth) / 2; $newheight = $thheight; $offsety = 0; } else { $newwidth = $thwidth; $offsetx = 0; $newheight = $thwidth / $imgratio; $offsety = ($thheight - $newheight) / 2; } $tmp=imagecreatetruecolor($thwidth,$thheight); imagecopyresampled($tmp,$src,$offsetx,$offsety,0,0,$newwidth,$newheight,$imgwidth,$imgheight); $p = strpos($_SERVER['REQUEST_URI'], 'index.php'); $subpath = '/hmip/_thumb/'; $tmpfilename = $_SERVER['DOCUMENT_ROOT'].$subpath.$fnname; imagejpeg($tmp,$tmpfilename,100); imagedestroy($src); imagedestroy($tmp); return $tmpfilename; } ten kod też nadaje marginesy :-) tylko są czarne... da się je ustawić jakoś na białe? |
|
|
![]() ![]() |
![]() |
Aktualny czas: 8.10.2025 - 22:55 |