 |

steve_e
User
May 12, 2008, 1:41 PM
Post #1 of 9
(733 views)
Shortcut
|
|
Background colours on icons
|
Can't Post
|
|
Hi - I'm getting a strange effect on some uploaded graphics, where the background colour seems to be reversed. I'm not sure why, as it isn't happening all the time. I've tried various combinations (gif or jpg files, transparent or white images etc) but some images just seem to turn out black Any ideas?
|
|
|  |
 |

Dave
Staff
/ Moderator

May 12, 2008, 2:17 PM
Post #2 of 9
(732 views)
Shortcut
|
|
Re: [steve_e] Background colours on icons
[In reply to]
|
Can't Post
|
|
Hi Steve, Can you attach one of the files that this happens with so I can try uploading it locally and see if I get the same problem? Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 | |  |
 |

Dave
Staff
/ Moderator

May 13, 2008, 10:36 AM
Post #4 of 9
(589 views)
Shortcut
|
|
Re: [steve_e] Background colours on icons
[In reply to]
|
Can't Post
|
|
Hi Steve, It looks like it's being caused when the gif has a transparent background. I've added some code to the next version to keep the transparency. Note this only works if the image doesn't need to be resized. But your image shouldn't need to be resized. It will be in the next version, here's how to add it to yours (if you don't mind editing some code): Open this file /lib/menus/default/uploadForm_functions.php Make a backup copy! Search for "resample image" and add this code _above_ it:
if ($scaleFactor == 1) { copy($sourcePath, $targetPath) || die(__FUNCTION__ . ": error copying image '$sourcePath' - $php_errormsg"); return; } // resample image
Give that a try and let me know if it fixes it for you! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

steve_e
User
May 14, 2008, 4:57 AM
Post #5 of 9
(502 views)
Shortcut
|
|
Re: [Dave] Background colours on icons
[In reply to]
|
Can't Post
|
|
Hi Dave - Yes, that seems to work - but only for images that don't need to be re-sized as you say. Does the fix included in the next version (1.15?) allow images to be re-sized or will it still have a problem with gifs with transparent backgrounds? Regards, Steve.
|
|
|  |
 |

Dave
Staff
/ Moderator

May 14, 2008, 9:13 AM
Post #6 of 9
(488 views)
Shortcut
|
|
Re: [steve_e] Background colours on icons
[In reply to]
|
Can't Post
|
|
No, the fix doesn't support resizing transparent images yet. Do you have many transparent images that will need to be resized? Do you know how much they will be changing in size when they're resampled? I can take another look at it if you like. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

steve_e
User
May 14, 2008, 10:10 AM
Post #7 of 9
(486 views)
Shortcut
|
|
Re: [Dave] Background colours on icons
[In reply to]
|
Can't Post
|
|
It's not too much of a problem Dave. We add new pages regularly to a series which all have logos from various organisations, and we can't predict which ones will be over a particular size and which have transparent images. I have someone else who prepares these pages and she's not able to reprocess the images herself, so it just means that when she gets one that goes black she'll have to send it to me to remove the transparent background. It would be good to have an eventual fix though!
|
|
|  |
 |

Dave
Staff
/ Moderator

May 14, 2008, 11:26 AM
Post #8 of 9
(482 views)
Shortcut
|
|
Re: [steve_e] Background colours on icons
[In reply to]
|
Can't Post
|
|
I spent some time on it yesterday without any luck. There's quite a lot of discussion about the best way to do it (or how to at all) on the PHP.net discussion forums. If it keeps coming up post again and I'll bump it up the feature list. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

steve_e
User
May 14, 2008, 11:31 AM
Post #9 of 9
(481 views)
Shortcut
|
|
Re: [Dave] Background colours on icons
[In reply to]
|
Can't Post
|
|
Okey doke Dave, will do. Thanks for the prompt replies as usual!
|
|
|  |
|