When i set transparency to true the white around the edge is removed just fine (i say fine its very gagged and needs a way to be cleaned up). But inside the image any white is also removed is there a way i can stop this, and also hopefully tidy up the edges.
Joshua hatfield - 2010-03-12 13:34:53 - In reply to message 1 from Jason Brook
You know, I reviewed the code because I couldn't think of any functions in floIcon where you "set transparency" and I still don't see one. You should set transparency in whatever program you use to create the original image (i.e. Photoshop, Paint Shop Pro, GIMP, etc). Then, floIcon will automatically detect transparency (alpha transparency forces 32 bit storage, 257+ colors force 24 bit storage, etc.) when you add the image with addImage().
Let me know if any of this information helps and/or please provide me with any additional information that can be used to help you with your problem.
Jason Brook - 2010-03-12 14:20:18 - In reply to message 3 from Joshua hatfield
That would be why then i am taking in an ico file that doesnt support transparency and then using that to output a png file with the white areas as transparent.
I cant at the moment actually give a link to the file as the site is behind password protection. However if you think there is still a way to make the transparency work then i will setup another area on one of my other sites and link you to that.
Joshua hatfield - 2010-03-12 14:58:43 - In reply to message 4 from Jason Brook
So the source is an icon file, and you're extracting an image in the icon file that has no transparency and adding transparency to it by setting the gd transparency palette entry to white?
If this is correct, you should know that adding transparency in a visually appealing way to an image that does not have transparency (which seems what you want to do) is outside the scope of floIcon. It's scope is to take images and do a simple conversion from one type to another (ico => gd resource, gd resource => ico).
If you are trying to automate the process of adding transparency in a visually appealing way, floIcon is not going to be of assistance. I don't know of a class that does this, but I have not looked. Judging from the capability of professional imaging software (which require a decent amount of human interaction to properly do this task), I doubt this can be done well automatically.
I personally would suggest exporting the individual images as PNGs (you can do that here: http://blog.flobi.com/test/floIcon/ if you like or use floIcon to write your own page to do it) opening them individually in a graphics program (i.e. Photoshop, etc.), making the transparency as you desire, and import them back into the icon file.
I hope this information is helpful, and if I have misinterpreted your desires, please correct me.
Jason Brook - 2010-03-13 11:59:09 - In reply to message 6 from Jason Brook
Sorry for bothering you again but i was wondering on your site, i think its your site at this address: http://blog.flobi.com/test/floIcon/
That is what i want to do with the favicon part only at the bottom essentially i have written a script that finds the favicon on the site. I want to be able to do exactly what your script does there and load a png image back that is the same size and is transparent background however in this example that i made the image comes back totally wrong, all squashed and everything.
Joshua hatfield - 2010-03-13 19:37:19 - In reply to message 7 from Jason Brook
Are you using the newest version (1.1.1)? I was looking through the revisions and some of the older ones had trouble with some images. The current version is what is on http://blog.flobi.com/test/floIcon/ and it's not having a problem with the facebook image. I'm not sure what else to say unless you have more information for me.
Joshua hatfield - 2010-03-14 21:42:07 - In reply to message 9 from Jason Brook
I'm curious where you got that. The only place I've authorized for distribution is phpclasses.org and I can't find the older versions on here.
I'm glad that took care of your issue. I'd seen icon issues like that when I had some mathematic issues parsing the bits in the ico file.
As far as getting the favicon from a site, I just use file_get_contents() to download it and try the normal locations which are /favicon.ico and favicon.ico in the current folder. Also, checking the meta tags for a ref to the file. I could copy/paste you the code when I get to a computer, but I can't really do that from my iPhone.