Is it the script or is the GD that is not precise,
It makes an red border in the bottom and on the right hand side of the picture + the quality is very poor.
$file = "../../images/dynamic/images/$orgFile";
$src = ImageCreateFromJPEG($file);
$filesize = filesize($file);
$org_h = imagesy($src);
$org_w = imagesx($src);
if (isset($keepProp)) {
if ($org_w > $org_h) {
$cfg->width = $thumbWidth;
$cfg->height = floor ($cfg->width * $org_h / $org_w);
}
else {
$cfg->height = $thumbHeight;
$cfg->width = floor ($cfg->height * $org_w / $org_h);
}
}
else {
$cfg->width = $thumbWidth;
$cfg->height = $thumbHeight;
}
$img = ImageCreate($cfg->width,$cfg->height);
ImageCopyResized ($img, $src, 0, 0, 0, 0, $cfg->width, $cfg->height, $org_w, $org_h );
ImageJPEG($img, "../../images/dynamic/thumbs/$orgFile", 100);
ImageDestroy ($img);
ImageDestroy ($src);