We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using compress image from codeigniter 4 library with below code :
\Config\Services::image()->withFile($this->request->getFile('storeimage'))->reorient()->save('images/store/test.png', 70)
But it removes transparency png image. Can i compress png image without losses the transparency in ci 4?
I put below code in GDHanlder.php (save function) but it makes compress image not working, image size result still same and not compressed
imageAlphaBlending($this->resource, true); imageSaveAlpha($this->resource, true);
case IMAGETYPE_PNG: imageAlphaBlending($this->resource, true); imageSaveAlpha($this->resource, true); if (! function_exists('imagepng')) { throw ImageException::forInvalidImageCreate(lang('images.pngNotSupported')); } if (! @imagepng($this->resource, $target)) { throw ImageException::forSaveFailed(); } break;
The text was updated successfully, but these errors were encountered:
@ivanz040592 Sorry for the delay in responding.
Try this:
--- a/system/Images/Handlers/GDHandler.php +++ b/system/Images/Handlers/GDHandler.php @@ -251,6 +251,9 @@ class GDHandler extends BaseHandler throw ImageException::forInvalidImageCreate(lang('Images.pngNotSupported')); } + imagealphablending($this->resource, false); + imagesavealpha($this->resource, true); + if (! @imagepng($this->resource, $target)) { throw ImageException::forSaveFailed(); }
Sorry, something went wrong.
This bug was fixed in the develop branch. And it would be included in v4.2.0.
develop
Successfully merging a pull request may close this issue.
I am using compress image from codeigniter 4 library with below code :
But it removes transparency png image. Can i compress png image without losses the transparency in ci 4?
I put below code in GDHanlder.php (save function) but it makes compress image not working, image size result still same and not compressed
The text was updated successfully, but these errors were encountered: