ik heb een thumbnail creator van php.net afgehaald en gebruik deze in mijn foto scripts. Op mijn ene server is PHP 4 geinstaleerd en hier werkt hij prima. op mijn andere server staat PHP 5. Het script weigert hier te werken. Heeft iemand enig idee?

<?
header("Content-type: image/jpeg");
$source = imagecreatefromjpeg($src);
$orig_w=imagesx($source);
$orig_h=imagesy($source);

if ($orig_w>$wmax || $orig_h>$hmax)
{
$thumb_w=$wmax;
$thumb_h=$hmax;
if ($thumb_w/$orig_w*$orig_h>$thumb_h)
$thumb_w=round($thumb_h*$orig_w/$orig_h);
else
$thumb_h=round($thumb_w*$orig_h/$orig_w);
} else
{
$thumb_w=$orig_w;
$thumb_h=$orig_h;
}
if (!@$bgcol)
{
$thumb=imagecreatetruecolor($thumb_w,$thumb_h);
imagecopyresampled($thumb,$source,
0,0,0,0,$thumb_w,$thumb_h,$orig_w,$orig_h);
}
else
{
$thumb=imagecreatetruecolor($wmax,$hmax);
imagefilledrectangle($thumb,0,0,$wmax-1,$hmax-1,intval($bgcol,16));
imagecopyresampled($thumb,$source,
round(($wmax-$thumb_w)/2),round(($hmax-$thumb_h)/2),
0,0,$thumb_w,$thumb_h,$orig_w,$orig_h);
}
if (!@$quality) $quality=90;
imagejpeg($thumb,"",$quality);
imagedestroy($thumb);
?>
Wat voor error krijg je?
geen error, maar dat kan ook komen omdat errors in .ini uitstaan, kan dat alleen nu niet aanpassen zit op me werk. daar is toch ook een functie voor in PHP??
je onderdrukt ook je fouten met @, haal die eerst maar eens weg, klote debuggen zo
ik krijg nu nog steeds geen errors:

<?
error_reporting(E_ALL);
header("Content-type: image/jpeg");
$source = imagecreatefromjpeg($src);
$orig_w=imagesx($source);
$orig_h=imagesy($source);

if ($orig_w>$wmax || $orig_h>$hmax)
{
$thumb_w=$wmax;
$thumb_h=$hmax;
if ($thumb_w/$orig_w*$orig_h>$thumb_h)
$thumb_w=round($thumb_h*$orig_w/$orig_h);
else
$thumb_h=round($thumb_w*$orig_h/$orig_w);
} else
{
$thumb_w=$orig_w;
$thumb_h=$orig_h;
}
if (!$bgcol)
{
$thumb=imagecreatetruecolor($thumb_w,$thumb_h);
imagecopyresampled($thumb,$source,
0,0,0,0,$thumb_w,$thumb_h,$orig_w,$orig_h);
}
else
{
$thumb=imagecreatetruecolor($wmax,$hmax);
imagefilledrectangle($thumb,0,0,$wmax-1,$hmax-1,intval($bgcol,16));
imagecopyresampled($thumb,$source,
round(($wmax-$thumb_w)/2),round(($hmax-$thumb_h)/2),
0,0,$thumb_w,$thumb_h,$orig_w,$orig_h);
}
if (!$quality) $quality=90;
imagejpeg($thumb,"",$quality);
imagedestroy($thumb);
?>
wat is $src waar komt dat weg?
sorry ik heb het al gevonden,

ik heb deze fout al zo vaak gemaakt , in PHP 4 hoefde je niet persee je variabelen te getten.

in PHP 5 moet dat wel een simpele voldeed dus:

<?
$src = $_GET[src];
$wmax = $_GET[wmax];
$hmax = $_GET[hmax];
$bgcol = $_GET[bgcol];
$quality = $_GET[quality];
?>

harstikke bedankt!
zet ze nog even tussen ''

$quality = $_GET['quality'];

netjes programmeren :)

misschien ook wel iets om te kijken of je vars wel geset zijn , dan afvangen met een foutmelding. krijg je ook geen gedonder

Reageren