Файл: www/lcompress.php
Строк: 17
<?php
function compress_image ( $source_url , $quality ) {
$info = getimagesize ( $source_url ) ;
if ( $info [ 'mime' ] == 'image/jpeg' ) $image = imagecreatefromjpeg ( $source_url ) ;
elseif ( $info [ 'mime' ] == 'image/gif' ) $image = imagecreatefromgif ( $source_url ) ;
elseif ( $info [ 'mime' ] == 'image/png' ) $image = imagecreatefrompng ( $source_url ) ;
header ('Content-Type: image/jpeg');
//save it
echo imagejpeg ( $image , NULL, $quality ) ;
//return destination file url
}
compress_image ('data/img/location/locs/'.intval($_GET['li']).'.png',$_GET['q']);
?>