es zinu ka to var panākt vienkārši ar softiem, bet ja tev tieši ar php palīdzību vajag nu varbūt šis noderēs.
itkā tas ir iekš drupal, bet varbūt būs saprotams.
PS. tik šis ir jpeg, bet to pašu itkā varētu panāk arī priekš gif.
<?php
function image_gd_close($res, $destination, $extension) {
$extension = str_replace('jpg', 'jpeg', $extension);
$close_func = 'image'. $extension;
if (!function_exists($close_func)) {
return false;
}
if ($extension == 'jpeg') {
return $close_func($res, $destination, variable_get('image_jpeg_quality', 75));
}
else {
return $close_func($res, $destination);
}
}
?>