I am using a dark-themed template. When images are resized for the various placements (prod, cat, etc) the sides show white. (Nothing new).
However, I sell books and cds.
While this is OK for CDs which are square, it really looks bad for books.
Is there a code to allow for one dimension to auto-config proportionately?
Example:
width = 200 px
height = calculated from the original to whatever the proportional height would be.
Thank you.
Not 100% on this, so backup first
open: system/library/image.php
find
change to
open: system/library/image.php
find
Code: Select all
if (isset($this->info['mime']) && $this->info['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);
}
imagefilledrectangle($this->image, 0, 0, $width, $height, $background);
Code: Select all
if (isset($this->info['mime']) && $this->info['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, 1, 1, 1);
}
imagefilledrectangle($this->image, 0, 0, $new_width, $new_height, $background);
It worked, however, it ONLY works for PNG images saved at 24 bit, transparent. So, I will have to go back and save all my JPGs as PNG files using a transparent photoshop layer, which is fine, but a little time consuming.
Thank you.
Thank you.
Who is online
Users browsing this forum: No registered users and 3 guests