$maxWidth || $h > $maxHeight) { if (round($w / $maxWidth, 4) > round($h / $maxHeight, 4)) { $tmp = round($w / $maxWidth, 4); } else { $tmp = round($h / $maxHeight, 4); } $newWidth = round($w / $tmp); $newHeight = round($h / $tmp); $ni = imagecreatetruecolor($newWidth, $newHeight); imagecopyresampled($ni, $im, 0, 0, 0, 0, $newWidth, $newHeight, $w, $h); imagejpeg($ni, $newfile, '75'); } // when the original sizes are smaller than the max else { $ni = imagecreatetruecolor($w, $h); imagecopyresampled($ni, $im, 0, 0, 0, 0, $w, $h, $w, $h); imagejpeg($ni, $newfile, '75'); } chmod($newfile, 0777); return (true); } } function mappen($beginmap) { $handle = opendir($beginmap); while (false!==($file = readdir($handle))) { if ($file != "." && $file != "..") { $bestandenarray[] = $file; } } closedir($handle); rsort($bestandenarray); foreach ($bestandenarray as $key => $val) { echo '\n"; chmod($beginmap.$val, 0666); } } function countFiles($map) { // count op nul zetten $i = 0; $handle = opendir($map); while (false!==($file = readdir($handle))) { if ($file != "." && $file != "..") { $i++; } } return $i; } ?>