Home | Products | Consulting | Hosting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Background colours on icons

 

 


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


steve_e
User

May 12, 2008, 2:32 PM

Post #3 of 9 (731 views)
Shortcut
Re: [Dave] Background colours on icons [In reply to] Can't Post

Hi Dave -
Here's a link to a page that has the 'negative' logo:

http://www.foundation-stage.info/images2/LEAs/yorklogo_001.gif

Here's the original logo that I uploaded:

Hope that works. Let me know if you need anything else.
Attachments: yorklogo.gif (15.7 KB)


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:


Code
 
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! Smile


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! Smile

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4