Needs work
Project:
ImageCache
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Jan 2009 at 23:11 UTC
Updated:
3 Jun 2012 at 00:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dman commented(whoops, needed doc format to embed this sample img)

Comment #2
drewish commentedcould we just use an empty string? i'd be okay with an update function that checked the actions and migrated the values...
Comment #3
dman commentedEither is good.
I just saw that -1 was already established as the constant in PHP core docs, so didn't think it needed abstracting.
For most users, I'm guessing that pre-populating the form with #FFFFFF is desired anyway, and would be a UI help.
Consciously deleting it, with the effect being documented, would be OK and not create surprises.
More than anything, I just wanted a simple patch to avoid changing that code/logic more than was necessary. Which is not an excuse for not actually improving it :-)
Comment #4
drewish commentedi think you're right to leave white as the default but i'd prefer not to use -1, i think an empty value is much clearer to the user that they want no color.
Comment #5
mcjim commentedI tried this out and found I had to add:
imagesavealpha($image->res, TRUE);before the final
return true;to keep the alpha transparency. Does that seem right? First time I've messed with this image manipulation stuff, so a little unsure here.Agree that an empty value would be better than -1: other imagecache actions use an empty value.
Comment #6
kirie commentedI got some errors when I tried to apply this, and figured out it was caused by some internal imagecache property renaming:
$image->resis now$image->resource. I edited the patch above and attached it (I also changed '-1' to empty as per above comments).Comment #7
drewish commentedI marked #434476: imagecache_rotate action produces jagged lines and black background as a duplicate of this.
Over on #422836: ImageAPI GD2 6.x-1.5 ignores crop background color setting I fixed and ImageAPI bug that wasn't passing the background colors through. The attached patch uses NULL as per the new ImageAPI release.
Comment #8
drewish commentedcommitted that to HEAD and DRUPAL-5--2. probably need to clean up the actions some more but that can be follow up.
Comment #10
afox commentedHey, I'm using the latest Imagecache dev(2009-Oct-09) and this issue is still on it! I made sure that the patch was committed, but I'm still having black background on a transparent png when rotating.
Running Core D6.15
Anyone else still having this issue?
Comment #11
kevster commentedYes - still having this problem, have tried the above patch but didn't work for me? I might try an earlier version as the patch differs from the code I have. Weird as we had this working at one point and not sure how it broke...
working off imagecache 6.x-2.0-beta10...
Did you have any luck yet?
Comment #12
nchase commentedsome time ago I had the same problems... It was an error from the gd library... using different libraries results in different images, once with correct transparency once with a background...
the second thing was using jpg's.. I had to convert them to pngs first and then applying the rotation.
Comment #13
kevster commentedThanks for the advice snicers - when I checked the dupal settings for GD library it said there may be problems with image rotation. We will look at updating/reinstalling GD libs and see if that helps. I have been converting to PNG first but no change.
Thx - Kevin
Comment #14
fizk commentedMarking as ImageCache 3.x Todo.