- Posts: 5
COMMUNITY FORUM
png's transparency not respected in K2 articles?
- Eric Tripp
-
Topic Author
- Offline
- New Member
Less
More
15 years 3 months ago #77937
by Eric Tripp
png's transparency not respected in K2 articles? was created 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.
- Simon Wells
-
- Offline
- Platinum Member
Less
More
- Posts: 955
15 years 3 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.
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.
- Nathan Brown
-
- Offline
- New Member
Less
More
- Posts: 11
14 years 10 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.
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.
- scott cameron
-
- Offline
- New Member
Less
More
- Posts: 16
14 years 9 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
Scott
Please Log in or Create an account to join the conversation.
- Eric Tripp
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
14 years 9 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.
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.
- scott cameron
-
- Offline
- New Member
Less
More
- Posts: 16
14 years 9 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.
- David Wood
-
- Offline
- New Member
Less
More
- Posts: 3
14 years 6 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.
- Elisa F.
-
- Offline
- Junior Member
Less
More
- Posts: 32
14 years 3 weeks ago #77944
by Elisa F.
Replied by Elisa F. on topic png's transparency not respected in K2 articles?
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.
- ingo
-
- Offline
- New Member
Less
More
- Posts: 2
13 years 11 months ago #77945
by ingo
Replied by ingo on topic png's transparency not respected in K2 articles?
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?
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.
- Elisa F.
-
- Offline
- Junior Member
Less
More
- Posts: 32
13 years 11 months ago #77946
by Elisa F.
Replied by Elisa F. on topic png's transparency not respected in K2 articles?
yes i meant jpg,.. :-) but haven´t found a solution, yet...
Please Log in or Create an account to join the conversation.
- Yan
-
- Offline
- New Member
Less
More
- Posts: 1
13 years 11 months ago #77947
by Yan
Replied by Yan on topic png's transparency not respected in K2 articles?
same problem. need png for some goods, but when uploading png images, K2 converts them into jpg. it's a big problem - first time i tried this component and such fail. three days gone, no job done. hope, some solution will come after more than year this question appeared first time. but I find it hard to believe. но надежда умирает последней....
Please Log in or Create an account to join the conversation.
- Babblespring Design and Development
-
- Offline
- New Member
Less
More
- Posts: 1
13 years 10 months ago #77948
by Babblespring Design and Development
Replied by Babblespring Design and Development on topic png's transparency not respected in K2 articles?
Hi...new here,
If you look in administrator/components/com_k2/models/item.php around line 200 you'll see the images being converted according to size. Change jpg to your desired extension and then in components/com_k2/models/item.php around line 110 change the corresponding size extension. Not a great solution (a pretty bad one actually) but it saved me in a crunch.
Hope this helped.
If you look in administrator/components/com_k2/models/item.php around line 200 you'll see the images being converted according to size. Change jpg to your desired extension and then in components/com_k2/models/item.php around line 110 change the corresponding size extension. Not a great solution (a pretty bad one actually) but it saved me in a crunch.
Hope this helped.
Please Log in or Create an account to join the conversation.