Hallo daar,

Ik ben bezig met een album site.
Nu heb ik een multi upload gevonden op het internet.
dit werkt allemaal heel goed.
Maar nu wil ik de foto verkleinen. Bij de thumbs werkt dit goed.
Maat wil ik verkleinen naar 600 Width of height.
Dan komt hij niet in de map.

<?php require_once "phpuploader/include_phpuploader.php" ?>
<?php
mysql_connect('localhost','Geb','ww');
mysql_select_db('data?_site');
$uploader=new PhpUploader();

$mvcfile=$uploader->GetValidatingFile();

if($mvcfile->FileName=="accord.bmp")
{
$uploader->WriteValidationError("My custom error : Invalid file name. ");
exit(200);
}

//USER CODE:

$targetfilepath= "../fotos/".$_GET['map'] ."/". $mvcfile->FileName;
mysql_query("INSERT INTO pictures (cat,foto) VALUES ('".$_GET['id']."','".$mvcfile->FileName."')");

if( is_file ($targetfilepath) )
unlink($targetfilepath);
$mvcfile->MoveTo( $targetfilepath );

$uploader->WriteValidationOK();

$url = "../fotos/".$_GET['map']."/".$mvcfile->FileName;
$pic = @imagecreatefromjpeg($url) or die ("Image not found!");
if ($pic) {
$width = imagesx($pic);
$height = imagesy($pic);
if($width > $height)
{
$twidth = "140"; # width of the thumb 160 pixel
$theight = $twidth * $height / $width; # calculate height\
}
else
{
$theight = "140"; # calculate height\
$twidth = $theight * $width / $height; # width of the thumb 160 pixel
}
$thumb = @imagecreatetruecolor ($twidth, $theight) or
die ("Can't create Image!");
imagecopyresized($thumb, $pic, 0, 0, 0, 0, $twidth, $theight, $width, $height); # resize image into thumb
imagejpeg($thumb, '../fotos/thumb/'.$_GET['map'].'/'. $mvcfile->FileName); # Thumbnail as JPEG
imagedestroy($thumb);
}
$show = @imagecreatefromjpeg($url) or die ("Image not found!");
if ($show) {
$s_width = imagesx($show);
$s_height = imagesy($show);
if($s_width > $s_height)
{
$swidth = "600"; # width of the thumb 160 pixel
$sheight = $swidth * $s_height / $s_width; # calculate height\
}
else
{
$sheight = "600"; # calculate height\
$swidth = $sheight * $s_width / $hs_eight; # width of the thumb 160 pixel
}
$show2 = @imagecreatetruecolor ($swidth, $sheight) or
die ("Can't create Image!");
imagecopyresized($show2, $pic, 0, 0, 0, 0, $swidth, $sheight, $s_width, $s_height); # resize image into thumb
imagejpeg($show2, '../fotos/show/'.$_GET['map'].'/'. $mvcfile->FileName); # Thumbnail as JPEG
imagedestroy($show2);
}


?>

iemand een idee ?

Bedankt alvast :D
Begin bij het debuggen, dus op welke regel gaat het mis?
Gooi ff je inlog gegevens van de database uit je voorbeeld.
Dit lijkt me niet de bedoeling.
@ frank bedankt voor de tip :$

@erwin Regel 46 moet er iets niet meer goed gaan want thumb doet hij het nog wel :S
Heb je gecontroleerd wat de waardes in de variabelen zijn, klopt dat met wat je denkt dat er zou moeten zijn? Zo nee, wat is er niet goed?
Ik denk dat het allemaal klopt want de thumb regel doet hij wel en ik heb de $show regel gewoon over genomen :S
Guillaume Storimans op 29/12/2011 23:36:57

Ik denk

Mooi zo, dan hoeven we je dus ook niet meer te helpen....

Of wil je hiermee zeggen dat je dus nog niets hebt geprobeerd. Niet hebt gechecked of alle variabelen wel juist zijn? Of je wel op de juiste plekken komt? Met andere woorden, of je wel een begin hebt gemaakt met debuggen. Als jij dat niet doet, hoe moeten wij het dan doen?

Erwin H op 29/12/2011 23:50:28

[quote="Guillaume Storimans op 29/12/2011 23:36:57"]
Ik denk

Mooi zo, dan hoeven we je dus ook niet meer te helpen....
[/quote]
Iets vriendelijker mag ook wel he ;) Wat voor jou vanzelfsprekend is, is dat voor iemand anders misschien niet (direct) en ja, dan gebeurt het wel eens dat je iets 2x moet uitleggen of vragen...

Je hebt gelijk, het is ook laat....
Blijft de vraag alleen wel staan over wat voor debugging er al heeft plaatsgevonden. Want om te helpen is er wel iets meer info nodig.

Reageren