Das mit dem weissen Bildrand stammt von der
image.php datei im
system/library/... Verzeichnis.
OC v.3.0.2.x:
Code: Select all
if ($this->mime == 'image/png') {
imagealphablending($this->image, false);
imagesavealpha($this->image, true);
$background = imagecolorallocatealpha($this->image, 255, 255, 255, 127);
imagecolortransparent($this->image, $background);
} else {
$background = imagecolorallocate($this->image, 255, 255, 255);
}
In meiner OC v.1.5.6.5 sieht es so aus:
Code: Select all
//JTI MOD - $background = imagecolorallocatealpha($this->image, 255, 255, 255, 127);
$background = imagecolorallocatealpha($this->image, 215, 215, 215, 127);
imagecolortransparent($this->image, $background);
} else {
//JTI MOD - $background = imagecolorallocate($this->image, 255, 255, 255);
$background = imagecolorallocate($this->image, 215, 215, 215);
}
imagefilledrectangle($this->image, 0, 0, $width, $height, $background);
imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);
und produziert das, anstatt in weiss:

---
Oder dann Bilder mit dunklem Hintergrund:
Code: Select all
//JTI MOD - $background = imagecolorallocatealpha($this->image, 255, 255, 255, 127);
$background = imagecolorallocatealpha($this->image, 68, 0, 0, 127);
imagecolortransparent($this->image, $background);
} else {
//JTI MOD - $background = imagecolorallocate($this->image, 255, 255, 255);
$background = imagecolorallocate($this->image, 68, 0, 0);
}
imagefilledrectangle($this->image, 0, 0, $width, $height, $background);
imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);
Und mit dieser Routine, unmittelbar nach der obigen Routine plaziert, kann man die
Bilder auch noch etwas nachschärfen, was auf die Qualität auch einen Einfluss hat:
Code: Select all
//JTI MOD Image Sharpening Code
$matrix = array(
array(0.0, -1.0, 0.0),
array(0.0, 6.0, 0.0),
array(0.0, -1.0, 0.0)
);
...
Vielleicht hilft's.
Ernst