Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle alpha for webp if source have alpha #161

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

Merged
peter279k merged 1 commit into gumlet:master from dreammeup:patch-1
Jul 31, 2020

Conversation

@dreammeup
Copy link
Contributor

@dreammeup dreammeup commented Jul 31, 2020

If the source file is a png, then we can keep the alpha for saving in webp format.

If the source file is a png, then we can keep the alpha for saving in webp format
@dreammeup dreammeup changed the title (削除) Handle alpha for webp is source have alpha (削除ここまで) (追記) Handle alpha for webp if source have alpha (追記ここまで) Jul 31, 2020
@peter279k peter279k self-requested a review July 31, 2020 09:13
}

imagealphablending($dest_image, false);
imagesavealpha($dest_image, true);
Copy link
Contributor

@peter279k peter279k Jul 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any sample codes and images to prove this change?

Copy link
Contributor Author

@dreammeup dreammeup Jul 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
Sure, here is the code used :

$image = new \Gumlet\ImageResize($base_image);
$image->resizeToWidth(300);
$image->save('2-1f216112gm37-w300.webp', IMAGETYPE_WEBP);

In attachment, 2-1f21g14309151-w300 is the test before the modification, the alpha in the png is not kept.
2-1f216112gm37-w300 is the test after modification.

https://drive.google.com/file/d/1gQIqlC3ZMXtj4JffsRkwyQDrkB99Wa7Y/view?usp=sharing

peter279k reacted with thumbs up emoji dreammeup and linushstge reacted with hooray emoji
@peter279k peter279k merged commit 72be1e2 into gumlet:master Jul 31, 2020
@dreammeup dreammeup deleted the patch-1 branch July 31, 2020 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@peter279k peter279k peter279k left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /