Skip to content
New issue

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

fix: GDHandler::save() removes transparency #5971

Merged

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented May 6, 2022

Description
Fixes #4178

How to Test:
Prepare sample.png with transparency.

<?php
namespace App\Controllers;
class Home extends BaseController
{
    public function index()
    {
        \Config\Services::image('gd')
            ->withFile(WRITEPATH . 'sample.png')
            ->reorient()
            ->save(WRITEPATH . 'new.png', 70);
    }
}

Run the controller, and see new.png.

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label May 6, 2022
@kenjis kenjis merged commit 45e8278 into codeigniter4:develop May 7, 2022
@kenjis kenjis deleted the fix-GDHandler-save-transparency branch May 7, 2022 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Compress image manipulation removes png image transparency
2 participants