Files
motion/imgscale.php
2026-02-03 15:01:59 +01:00

41 lines
754 B
PHP
Executable File

<?php
require_once 'auth.php';
$b = isset($_GET['b']) ? $_GET['b'] : '160';
$q = isset($_GET['q']) ? $_GET['q'] : '75';
$bild = $_GET['bild'];
header('Content-Type: image/jpeg');
#$bild_src = imagecreatefromjpeg($bild);
#$bild_neu = imagescale ( $bild_src , $b ,-1 ,IMG_BICUBIC_FIXED);
#imagejpeg( $bild_neu, NULL, $q );
#imagedestroy($tmpbild);
#header('Content-Type: image/jpeg');
#echo "test";
$bild_src = imagecreatefromjpeg($bild);
$height = imagesy($bild_src);
$width = imagesx($bild_src);
$h = round($b/$width*$height);
$bild_neu = imagecreatetruecolor($b, $h);
imagecopyresampled($bild_neu, $bild_src, 0, 0, 0, 0, $b, $h, $width, $height);
imagejpeg( $bild_neu, NULL, $q );
imagedestroy($bild_src);
imagedestroy($bild_neu);
?>