Keyword

png's transparency not respected in K2 articles?

  • Eric Tripp
  • Eric Tripp's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #77937 by Eric Tripp
I have some png images that have transparency which is respected by Joomla when I use them in a custom html module, but when I place the same image in the body of a K2 item, the same way I did in the module, by using the JCE Image Manager, the transparency is lost and replaced with a white background and a border.Is there someway or somewhere to adjust this so the transparency is respected in K2?Additionally, is there some way to use png's with transparency as the main K2 image as uploaded under the Image tab for items, categories, etc.?Thanks

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #77938 by Simon Wells
Replied by Simon Wells on topic png's transparency not respected in K2 articles?
Hi Eric,
We use various images at K2Joom including some with transparency in png format.
These are uploaded through the Image Tab in the item and handled by JCE too, I do not recall any issues.

I will make a check and post a response shortly.

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #77939 by Nathan Brown
Replied by Nathan Brown on topic png's transparency not respected in K2 articles?
lol. I guess simon found that there is an issue and decided NOT to respond shortly... or longly :P

The only hack I've found for this (and it's untested - so be careful) is to upload your source .png over the k2's cached version (found by looking at the src of the front end article).

Not perfect but it seems to work so far...

Simon Wells (K2 Support) said:Hi Eric, We use various images at K2Joom including some with transparency in png format.
These are uploaded through the Image Tab in the item and handled by JCE too, I do not recall any issues.

I will make a check and post a response shortly.

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #77940 by scott cameron
Replied by scott cameron on topic png's transparency not respected in K2 articles?
Anyone resolve this issue I too have the same problem I need to use transparent PNG and when uploaded into K2 the transparency is lost..this is critical to my site development

Scott

Please Log in or Create an account to join the conversation.

  • Eric Tripp
  • Eric Tripp's Avatar Topic Author
  • Offline
  • New Member
More
14 years 2 months ago #77941 by Eric Tripp
Replied by Eric Tripp on topic png's transparency not respected in K2 articles?
I finally found the source of this border and background around the images.

This is actually the default setting in the K2.css file!!!

If you look through the different sections you will see it in the code associated with img property lines.

For example, in the "Component: Item view" section the lines below control the images in the areas for IntroText & FullText

div.itemIntroText img {padding:2px;margin:4px;background:#fff;border:1px solid #ccc;}
or
div.itemFullText img {padding:2px;margin:4px;background:#fff;border:1px solid #ccc;}

Go through the K2.css file and delete "background:#fff;border:1px solid #ccc;" from each instance that you find this associated with an "img" line, in each section, to stop K2 from rendering images this way.

I love K2, but it seems like a strange default to force every image to have a border and background when it is so easy to add a border in the editor, if that's what you really want, and if you want a background then just save it with one.

At least it is easy to resolve, just another 20 min spent in the land of CSS.

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #77942 by scott cameron
Replied by scott cameron on topic png's transparency not respected in K2 articles?
thank you for the help but it's all foreign to me..I took a look a the css file and there are a lot of img tags so I cannot figure out which one to remove..you listed only 2 lines but you say remove them all..if I remove all them it will make the css file corrupt

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #77943 by David Wood
Replied by David Wood on topic png's transparency not respected in K2 articles?
Thanks for that answer but I'm having the very same problem and deleted the lines you said (Only them). It won't go away!

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #77944 by Elisa F.
that doesn´t work for me. i upload a png and get an img in the sourcecode,..

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #77945 by ingo
i think elisa meant that the output is a jpg-file. i have the same problem. when you upload a .png you'll get a jpeg.

so any transparancy is gone. 

i don't want k2 changing my filetype. for a new site we are bulding at the moment we need the transprent png's

is there a solution on this?

will it be better in future versions of k2?

 

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #77946 by Elisa F.
yes i meant jpg,.. :-) but haven´t found a solution, yet...

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum