open($zipFile, ZipArchive::CREATE); // Počáteční redukce rozměrů $scaledWidth = max((int)($width / 50), 1); $scaledHeight = max((int)($height / 50), 1); for ($i = 1; $i <= $count; $i++) { // Generování zmenšeného obrazu $image = imagecreatetruecolor($scaledWidth, $scaledHeight); // Barevný režim $color = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255)); imagefill($image, 0, 0, $color); // Přidání hladkých abstraktních tvarů for ($j = 0; $j < 500; $j++) { $shapeColor = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255)); imagefilledellipse( $image, rand(0, $scaledWidth), rand(0, $scaledHeight), rand(2, $scaledWidth / 10), rand(2, $scaledHeight / 10), $shapeColor ); } // Zvětšení na požadované rozměry $resizedImage = imagecreatetruecolor($width, $height); imagecopyresized($resizedImage, $image, 0, 0, 0, 0, $width, $height, $scaledWidth, $scaledHeight); imagedestroy($image); // Název souboru $fileName = "photo_" . str_pad($i, 2, '0', STR_PAD_LEFT) . ".jpg"; $tempImage = tempnam(sys_get_temp_dir(), 'img'); // Uložení obrázku s nastavenou kvalitou imagejpeg($resizedImage, $tempImage, $quality); imagedestroy($resizedImage); $zip->addFile($tempImage, $fileName); } $zip->close(); readfile($zipFile); unlink($zipFile); exit; } ?> Dummy Photo Generator