PNG images won't show in NSP

News Show Pro GK5 - flexible, responsive and easily extendable free Joomla module support forum.
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Wed Sep 17, 2014 3:18 am
Hi Guys

Having a little bit of a problem understanding why NSP GK5 won't use the PNG files I have attached to my k2 items.

I wanted to have a custom image background for k2 items when displayed in page so they don't get washed out, however if I do this by creating the image as a JPG with background then the images doesn't look good when I have that k2 item shown in my setup NSP GK5 module.

Im not sure if my module itself is just having a problem, but I know that it was able to load a PNG image that was inserted into a k2 item and not through the k2 image insertion. I know that this method has been recommended, but once again I need to use the simplicity of just using the k2 image insertion not the in-content insertion.

Also read that you can create a default PNG file for automatic loading into module if item doesn't have an image. I have tried a few things. My module id is 'hero', which is identified as nsp-hero, its # id is 382. I have created both file extension names defaultnsp-382.png & defaultnsp-here.png and neither work. Create Thumbnails is 'Enabled'.

http://goo.gl/LPPUHU

I have been able to insert PNGs into k2 items using JoomlaChamps extension png4k2: http://www.joomlachamp.com/png-for-k2-items.html
This appears to be working correctly in k2 items, but these images are not showing in the modules.

Thanks in advance to helpful advice.
User avatar
Junior Boarder

GK User
Thu Sep 18, 2014 8:58 am
Hello,

The png images are defaultly not supported by K2 so its are not supported also in the NSP module. You can try to change .jpg to .png in the following file mod_news_pro_gk5/tmpl/com_k2/view.php
User avatar
Administrator

GK User
Fri Sep 19, 2014 3:50 am
Thanks for the idea and yes I was aware that k2 has limited it image use to JPGs only.
With regards to this module though, is it not possible to create an if statement to check for either a .jpg or .png file and use that?
I still have k2 items that do use .jpgs
User avatar
Junior Boarder

GK User
Fri Sep 19, 2014 10:13 am
Sorry but in this case there is no easy solution - it would be a custom work which is beyond of our technical support.
User avatar
Administrator

GK User
Tue Sep 23, 2014 12:42 am
Actually just had a look and found a working idea.
Changed:
Code: Select all
if(JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item['id']).'_'.$config['k2_image_size'].'.jpg')){ 
            $IMG_SOURCE = JURI::root().'media/k2/items/cache/'.md5("Image".$item['id']).'_'.$config['k2_image_size'].'.jpg';
              } else {


To
Code: Select all
if(JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item['id']).'_'.$config['k2_image_size'].'.jpg')){ 
            $IMG_SOURCE = JURI::root().'media/k2/items/cache/'.md5("Image".$item['id']).'_'.$config['k2_image_size'].'.jpg';
              }
         if(JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item['id']).'_'.$config['k2_image_size'].'.png')){ 
            $IMG_SOURCE = JURI::root().'media/k2/items/cache/'.md5("Image".$item['id']).'_'.$config['k2_image_size'].'.png';
              } else {


PNG images now loading in perfectly. (As far as I can tell)
User avatar
Junior Boarder

GK User
Thu Sep 25, 2014 4:21 am
Hi Gavick Team

Could you make the above code change in your NSP package? So that future releases will have this in by default.
Did the latest update to v1.6.3 and was wondering why I couldn't see my images on certain pages again.

Cheers
User avatar
Junior Boarder

GK User
Thu Sep 25, 2014 10:20 am
Ok, I'll add it in the next release of the module.
User avatar
Administrator


cron