#30596 closed defect (bug) (fixed)
Transparent background of .png not preserved when rotating picture
Reported by: | frankpw | Owned by: | markoheijnen |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Rotating .png picture with transparent background does not preserve transparency. Resulting picture has partially black background.
Attachments (3)
Change History (23)
#2
@
10 years ago
- Severity changed from major to normal
- Version changed from trunk to 3.5
Looks like this code has not been touched since at least 3.5. Is the same happening with Imagick?
#3
@
10 years ago
I had no chance to test Imagic as GD seems to be more popular and all my servers have GD installed ( but no Imagic ).
#4
@
10 years ago
I've been doing some testing and it doesn't seem like Imagick is doing it wrong. Created a new instance of WP_Image_Editor_Imagick, rotated it 180˚, saved it, and printed it out in an img. Visually the transparency is the same. Also created new Imagick instances to be able to check the image alpha itself. Long story short the alpha didn't change using Imagick.
#6
@
10 years ago
I was responding to boonebgorges's question since he asked if it did happen with Imagick. I did the testing and reported my findings.
#7
@
10 years ago
- Keywords 4.2-early added
- Milestone changed from Awaiting Review to Future Release
Thanks to both for your feedback. The patch looks fine at a glance. voldemortensen - since you were recently looking at the image unit tests, maybe you can dream up a way to write a test for this?
#9
@
10 years ago
Turns out it wasn't as hard as I thought it would be. Just had to use my brain. Patch includes the fix and unit tests for both Imagick and GD keeping alpha on rotate.
#11
@
10 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 31040:
#12
@
10 years ago
- Keywords has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening after seeing inconsistency in the usage of imagealphablending.
I believe the one in load
also should be true.
We could also move the lines into a separate protected method so others could use it too when extended the class. I do wonder if the function_exists is needed. It's there because of wp_imagecreatetruecolor
which is from #6005 so quite old.
#13
@
10 years ago
- Owner changed from wonderboymusic to markoheijnen
- Status changed from reopened to assigned
#15
@
10 years ago
@markoheijnen: Can you please follow up here on whether there's still a problem following [31040]? If there is, we're running out of time to fix this in 4.2.
#16
@
10 years ago
- Milestone changed from 4.2 to Future Release
No meaningful activity in several months, and it seems like we need a new patch. Let's pick this up in a future release. Sorry folks.
Formatting correction to previous patch