What does this CGsmartImage error in log mean?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

What does this CGsmartImage error in log mean?

Post by Gregor »

I get tons of error messages in de Admin log, related to CGSmartImage that it can't find a file in: NAN. Any help to identify the root cause would be highly appreciated.
[11-Mar-2018 07:54:05 Europe/Amsterdam] PHP Notice: Kan geen bestand vinden in: NAN in /home/efacti/public_html/uisge-beatha.eu/www/modules/CGSmartImage/action.default.php on line 44
[11-Mar-2018 07:54:05 Europe/Amsterdam] PHP Notice: Kan geen bestand vinden in: NAN in /home/efacti/public_html/uisge-beatha.eu/www/modules/CGSmartImage/action.default.php on line 44
[11-Mar-2018 07:54:05 Europe/Amsterdam] PHP Notice: Kan geen bestand vinden in: NAN in /home/efacti/public_html/uisge-beatha.eu/www/modules/CGSmartImage/action.default.php on line 44
[11-Mar-2018 07:54:05 Europe/Amsterdam] PHP Notice: Kan geen bestand vinden in: NAN in /home/efacti/public_html/uisge-beatha.eu/www/modules/CGSmartImage/action.default.php on line 44
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: What does this CGsmartImage error in log mean?

Post by HarmO »

NaN means is not a number in PHP.
So probably, the variable you give to your CGSmartyImage tag gives a "NaN" return.

It would help to have some more information on your cmsms install and maybe template code.
Kind regards,
HarmO
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: What does this CGsmartImage error in log mean?

Post by Gregor »

Thanks HarmO.

I use CGSI on various places on my site. A little more explaination on where the error was found in the log would help me to know where to look.

Is there any other way to find the cause of the error?
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: What does this CGsmartImage error in log mean?

Post by HarmO »

So you have no actual error on your website?
Kind regards,
HarmO
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: What does this CGsmartImage error in log mean?

Post by Gregor »

No, the front-end of the site doesn't show any errors, and all photo's where I use CGSI, are working as expected. The error log on the server shows:
[11-Mar-2018 07:54:05 Europe/Amsterdam] PHP Notice: Kan geen bestand vinden in: NAN in /home/efacti/public_html/uisge-beatha.eu/www/modules/CGSmartImage/action.default.php on line 44
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: What does this CGsmartImage error in log mean?

Post by HarmO »

Kind regards,
HarmO
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: What does this CGsmartImage error in log mean?

Post by Gregor »

Didn't try that one, but I managed to find it based on the number of NAN-error shown on a blog article page I concluded it must be the 'fotoalbum'-template.

I was using {root_url}/ in the src= link. Removing {root_url}/ solved it.

Thanks for pointing me to switch on debug mode.

Code: Select all

<div style="clear:both"></div>{* make sure heading is alignemt to the left *}
{* clean up parameters |replace:' ':'%20' *}
{assign var='album_no_spaces' value=str_replace(' ', ' ', "uploads/images/Gallery/{$gcb_params.album}")}
{assign var='foto_no_spaces' value=str_replace(' ', ' ', {$gcb_params.foto})}
{assign var="first_photo" value="uploads/images/Gallery/{$gcb_params.album}/{$gcb_params.foto}.jpg"}

<h4><span class="icon-camera"></span> Meer foto's in het album</h4>
{assign var='files' value="{$album_no_spaces}/*.jpg"|glob}
{if count($files)}
    <div class="floatbox" data-fb-options="doSlideshow:true group:`cgblog` caption:`href` header:`#socialmediashare1` preloadLimit:2">
        <a href="{$first_photo|cms_escape:'urlpathinfo'}">{CGSmartImage src="{$first_photo}" width="150" alt="Uisge Beatha, Zeilen" noresponsive=1}</a>
        {foreach from=$files item='file'}
            {if !$file|contains:"thumb_"}
                <a href="{$file|cms_escape:'urlpathinfo'}">{CGSmartImage src={$image->thumb} alt="{$image->titlename|substr:0:-4}" noresponsive=1}</a> 
            {/if}
        {/foreach}
    </div><p> {* needed to for come a warning on W3C validation *}
{/if}
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: What does this CGsmartImage error in log mean?

Post by velden »

Code: Select all

{CGSmartImage src="{$first_photo}" width="150" alt="Uisge Beatha, Zeilen" noresponsive=1}
...
{CGSmartImage src={$image->thumb} alt="{$image->titlename|substr:0:-4}" noresponsive=1}
I think it's possible to make it work like this (a little less quotes and brackets, might make it more efficient)

Code: Select all

{CGSmartImage src=$first_photo width="150" alt="Uisge Beatha, Zeilen" noresponsive=1}
...
{CGSmartImage src=$image->thumb alt=$image->titlename|substr:0:-4 noresponsive=1}
Further I think the Gallery module has an option to assign one picture as the 'album cover' (per gallery). Which maybe better to use than the code below. Though I don't know exactly what the intentions are.

Code: Select all

{assign var='foto_no_spaces' value=str_replace(' ', ' ', {$gcb_params.foto})}
{assign var="first_photo" value="uploads/images/Gallery/{$gcb_params.album}/{$gcb_params.foto}.jpg"}
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: What does this CGsmartImage error in log mean?

Post by Gregor »

velden wrote:

Code: Select all

{CGSmartImage src="{$first_photo}" width="150" alt="Uisge Beatha, Zeilen" noresponsive=1}
...
{CGSmartImage src={$image->thumb} alt="{$image->titlename|substr:0:-4}" noresponsive=1}
I think it's possible to make it work like this (a little less quotes and brackets, might make it more efficient)

Code: Select all

{CGSmartImage src=$first_photo width="150" alt="Uisge Beatha, Zeilen" noresponsive=1}
...
{CGSmartImage src=$image->thumb alt=$image->titlename|substr:0:-4 noresponsive=1}
Thanks, I'll give it a try. Not always sure when to use or not use brackets.
velden wrote:Further I think the Gallery module has an option to assign one picture as the 'album cover' (per gallery). Which maybe better to use than the code below. Though I don't know exactly what the intentions are.

Code: Select all

{assign var='foto_no_spaces' value=str_replace(' ', ' ', {$gcb_params.foto})}
{assign var="first_photo" value="uploads/images/Gallery/{$gcb_params.album}/{$gcb_params.foto}.jpg"}
The first line of code is obsolete. I'm not making use of the Gallery module. The second line of code is meant to point to the right folder location in order to for come to pass lenghty parameters.
Locked

Return to “Modules/Add-Ons”