Zaalclinic E-jeugd 19 oktober 2011
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
// Variabelen instellen
if($new_width && $new_height) {} else {
$new_width=100; //Image width Change if needed
$new_height=100; //Image height Change if needed
}
if($toonthumb) {} else { // wel of niet tonen van een thumbnail, standaard wel
$toonthumb = "ja";
}
$source_path = $rootmap."";
$destination_path=$rootmap."Thumbs/";
$image_name = $pfile;
$fotomap = str_replace("pics/","",$rootmap);
// De afbeelding die nu reeds op de server staat gaan resizen indien dat nodig is
$bronvanhetbestand = "$source_path/$image_name";
// bestandsextentie achterhalen
$path_parts = pathinfo($bronvanhetbestand);
$bestandstype = strtolower($path_parts["extension"]);
// Kijken of het niet om het bestand Thumbs.db gaat
if ($image_name && ($bestandstype == "jpg" || $bestandstype == "jpeg" || $bestandstype == "png" || $bestandstype == "gif")) {
// Eerst de huidige afmetingen achterhalen
list($popup_width, $popup_height, $pictype, $picattr) = getimagesize($bronvanhetbestand);
// Kijken of de bestanden niet al bestaan
if (file_exists("$source_path/Thumbs/thumb_$image_name")) {
// Foto tonen of alleen thumbnail maken
if($toonthumb == "ja") {
if($modFoto_galerij_tonen == 1 && !$fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 2 && $fgid) {
echo "";
} elseif($modFoto_galerij_tonen == 3 && $fgid) {
echo "";
} else {
echo "";
}
} else {
}
} else {
// Nieuw bestand creeren met de naam newImg
//$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
//$srcimg=ImageCreateFromJPEG($source_path.$image_name) or die("Problem In opening Source Image");
//ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
//ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
/*------------------------------------------------------------------------------------------*/
// maximale afmetingen bepalen
$max_pic_width = 100;
$max_pic_height = 100;
// Eerst de huidige afmetingen achterhalen
list($picwidth, $picheight, $pictype, $picattr) = getimagesize($bronvanhetbestand);
//echo "2. ".$bronvanhetbestand." - afmetingen bxh = $picwidth x $picheight
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>
"; // breedte is groter dan de maximale toegestane breedte EN het is een liggende afbeelding if (($picwidth > $max_pic_width) && ($picwidth > $picheight)) { //echo "3. afbeeldingopzet = liggend
"; //De nieuwe hoogte berekenen aan de gegevens van het oude plaatje en de doel breedte $doelhoogte = ($picheight * $max_pic_width) / $picwidth; //De hoogte, als het nodig is, afronden $doelhoogte = round($doelhoogte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == "jpg" || $bestandstype == "jpeg") { $image = @imagecreatefromjpeg($bronvanhetbestand); //echo "4. imagecreate = imagefromjpg
"; } elseif ($bestandstype == "png") { $image = @imagecreatefrompng($bronvanhetbestand); //echo "4. imagecreate = imagefrompng
"; } elseif ($bestandstype == "gif") { $image = @imagecreatefromgif($bronvanhetbestand); //echo "4. imagecreate = imagefromgif
"; } else { //echo "4. geen??
"; } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($max_pic_width, $doelhoogte); //Het nieuwe plaatje vullen met verkleinde plaatje @imagecopyresampled($destination, $image, 0, 0, 0, 0, $max_pic_width, $doelhoogte, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagejpeg
"; } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagepng
"; } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); //echo "5. img = imagegif
"; } // imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een staande afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth < $picheight)) { //echo "4. afbeeldingopzet = staand
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); // hoogte is groter dan de maximale toegestane hoogte EN het is een vierkante afbeelding } elseif (($picheight > $max_pic_height) && ($picwidth = $picheight)) { //echo "5. afbeeldingopzet = vierkant
"; //De nieuwe breedte berekenen aan de gegevens van het oude plaatje en de doel hoogte $doelbreedte = ($picwidth * $max_pic_height) / $picheight; //De breedte, als het nodig is, afronden $doelbreedte = round($doelbreedte, 0); //Het plaatje inlezen in de variabele $image if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { $image = @imagecreatefromjpeg($bronvanhetbestand); } else if ($bestandstype == 'png') { $image = @imagecreatefrompng($bronvanhetbestand); } else if ($bestandstype == 'gif') { $image = @imagecreatefromgif($bronvanhetbestand); } //$image = imagecreatefromjpeg($bronvanhetbestand); //een nieuw klein plaatje maken met de gewenste grootte $destination = imagecreatetruecolor($doelbreedte, $max_pic_height); //Het nieuwe plaatje vullen met verkleinde plaatje imagecopyresampled($destination, $image, 0, 0, 0, 0, $doelbreedte, $max_pic_height, $picwidth, $picheight); //Het plaatje opslaan if ($bestandstype == 'jpg' || $bestandstype == 'jpeg') { imagejpeg($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'png') { imagepng($destination,$source_path."/Thumbs/thumb_".$image_name); } elseif ($bestandstype == 'gif') { imagegif($destination,$source_path."/Thumbs/thumb_".$image_name); } //imagejpeg($destination,$bronvanhetbestand) or die("Probleem met opslaan"); //Het bronplaatje verwijderen imagedestroy($image); //Het doelplaatje verwijderen imagedestroy($destination); } else { //echo "6. afbeeldingen zijn precies de maximale afmetingen
"; copy($source_path.$pfile,$source_path."/Thumbs/thumb_".$image_name); } /*------------------------------------------------------------------------------------------*/ // Foto tonen of alleen thumbnail maken if($toonthumb == "ja") { if($modFoto_galerij_tonen == 1) { echo ""; } elseif($modFoto_galerij_tonen == 2 && $fgid) { echo ""; } elseif($modFoto_galerij_tonen == 3 && $fgid) { echo ""; } else { echo ""; } } else { } chmod ("$rootmap/Thumbs/thumb_$image_name",0644); } } ?>