Autor Zpráva
Frantisek Kuncl
Profil
Dobrý den,
na php.net jsem našel tento kó, která by měla dát do proměnných rozměry obrázku, se kterými potřebuji dál pracovat.

$filePath = "http://www.collegiummarianum.cz/fotogalerie/umelci/$foto";
function getFileSizeW($filePath){
$blah = getimagesize($filePath);
$type = $blah['mime'];
$width = $blah[0];
return $width;}

function getFileSizeH($filePath){
$blah = getimagesize($filePath);
$type = $blah['mime'];
$height = $blah[1];
return $height;}

$sizeW = getFileSizeW($file);
$sizeH = getFileSizeH($file);

Nicméně:
Fatal error: Cannot redeclare getfilesizew() (previously declared in f:wwwcm_newczumelciart_foto.php:88) in f:wwwcm_newczumelciart_foto.php on line 88

Co je špatně? Děkuji
tiso
Profil
funcia getimagesize Ti priamo vráti rozmery obrázku, prečo si definuješ tie vlastné funkcie?
Frantisek Kuncl
Profil
Když jsem zadal:
$size = getimagesize("http://www.collegiummarianum.cz/fotogalerie/umelci/$foto ");
echo = $size;

Výstup Array

Nevím, co s tím
Alphard
Profil
list($width, $height) = getimagesize("http://www.collegiummarianum.cz/fotogalerie/umelci/$foto ");
echo $width;
echo $height;
tiso
Profil
Frantisek Kuncl echo 'šírka: '.$size[0].' výška: '.$size[1];
Frantisek Kuncl
Profil
Dík moc, už jsem to začal hledat. Má tam smysl zadávat i index? $size = getimagesize[3]("http://www.collegiummarianum.cz/fotogalerie/umelci/$f oto "); ?
Toto téma je uzamčeno. Odpověď nelze zaslat.

0