add code
This commit is contained in:
45
imgscalewrite.php
Executable file
45
imgscalewrite.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
$b = isset($_GET['b']) ? $_GET['b'] : '160';
|
||||
$q = isset($_GET['q']) ? $_GET['q'] : '75';
|
||||
$c = isset($_GET['c']) ? $_GET['c'] : 'undef';
|
||||
$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 );
|
||||
imagejpeg( $bild_neu, "./popup/".$c."_".$b.".jpg", $q );
|
||||
|
||||
imagedestroy($bild_src);
|
||||
imagedestroy($bild_neu);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user