Hello everyone, I need a little help!
I have a problem with the background of some .png images. They are automatically uploaded from another site without a background. When resized, their background is black.
At the moment, the option is to remake all the photos, but that would take days.
How do I fix the problem?
The file: system / library / image.php has not been changed!
I have a problem with the background of some .png images. They are automatically uploaded from another site without a background. When resized, their background is black.
At the moment, the option is to remake all the photos, but that would take days.
How do I fix the problem?
The file: system / library / image.php has not been changed!
Last edited by VanioBoy on Mon Jun 28, 2021 3:00 pm, edited 3 times in total.
URL.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Just writing "URL." is unhelpful and unnecessary.
However, this question has been asked multiple times:
viewtopic.php?t=182332
viewtopic.php?t=130967
viewtopic.php?t=8818
And more.
So please always search before asking.
If none of those (and any others you find) solve your problem then you should pay a developer such as ourselves or post a job in the Commercial Support Forum.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Based on opinions.paulfeakins wrote: ↑Mon Jun 28, 2021 5:59 pmJust writing "URL." is unhelpful and unnecessary.
However, this question has been asked multiple times:
viewtopic.php?t=182332
viewtopic.php?t=130967
viewtopic.php?t=8818
And more.
So please always search before asking.
If none of those (and any others you find) solve your problem then you should pay a developer such as ourselves or post a job in the Commercial Support Forum.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
That comment makes absolutely no sense.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Hi, I checked the links, two of them are not on my question, and the third has no solution to the problem.
Thanks for joining though
I understand where the problem comes from, but I can't fix it. Photos with a black background are uploaded with the .jpg extension, but the photos are actually .png.
Thanks for joining though
I understand where the problem comes from, but I can't fix it. Photos with a black background are uploaded with the .jpg extension, but the photos are actually .png.
How to make this code run for .png and .jpg
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);
}
Who is online
Users browsing this forum: No registered users and 236 guests