SmartImage - not working for me

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
johnboyuk1
Forum Members
Forum Members
Posts: 128
Joined: Mon Nov 26, 2018 3:09 pm

SmartImage - not working for me

Post by johnboyuk1 »

Hi all

Just trying this new module... but it doesnt seem to do anything for me?!

I have this on my page to test it:

Code: Select all

{SmartImage src="uploads/images/DSC_0011.JPG"}
But its outputting absolutely nothing ... any idea where I'm going wrong?!

Thanks
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1256
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: SmartImage - not working for me

Post by DIGI3 »

Check your php error log and cmsms admin log for clues. Also check the generated html to see if it's creating the tag but the path is incorrect or something.
Not getting the answer you need? CMSMS support options
User avatar
rotezecke
Power Poster
Power Poster
Posts: 398
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: SmartImage - not working for me

Post by rotezecke »

Same issue here. Nothing in PHP error log (PHP 7.4.xx). Admin log shows:
Could not find a file at: uploads/images/DSC_0011.JPG
Edit: actually, there's also a notice in PHP error log:
Could not find a file at: uploads/images/DSC_0011.JPG in /var/www/public_html/modules/SmartImage/action.default.php on line 44
not working:

Code: Select all

{SmartImage src="uploads/images/DSC_0011.JPG"}
but this works:

Code: Select all

{SmartImage src="/uploads/images/DSC_0011.JPG"}
and this too works:

Code: Select all

{SmartImage src="../uploads/images/DSC_0011.JPG"}
and even this works

Code: Select all

{SmartImage src="images/DSC_0011.JPG"}
johnboyuk1
Forum Members
Forum Members
Posts: 128
Joined: Mon Nov 26, 2018 3:09 pm

Re: SmartImage - not working for me

Post by johnboyuk1 »

I get absolutely nothing - so no html / tag output at all

Nothing in the error logs either

Tried rotezecke's alternative path suggestions too but made no difference.
johnboyuk1
Forum Members
Forum Members
Posts: 128
Joined: Mon Nov 26, 2018 3:09 pm

Re: SmartImage - not working for me

Post by johnboyuk1 »

Ok, ive tried installing on another site - same server/pho set up and it works ok there... so how do I go about tracking down why its not working on this site?!
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3365
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: SmartImage - not working for me

Post by velden »

Wild guess: differences in path related settings in config.php?
johnboyuk1
Forum Members
Forum Members
Posts: 128
Joined: Mon Nov 26, 2018 3:09 pm

Re: SmartImage - not working for me

Post by johnboyuk1 »

ok - its something to do with the actual image ... it seems it doesnt like large images?! Which would make the plugin pretty useless for what I need it for - resizing images.

I cant work out whether its the file size or pixel dimensions it doesnt like - but tried the same image at 2.7mb and 1.2mb and got a blank output... if saved at 280kb it will output

Is this a bug?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1256
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: SmartImage - not working for me

Post by DIGI3 »

It's likely a memory issue, there should be an error in your log about it. Check your php memory limit and raise as needed.
Not getting the answer you need? CMSMS support options
johnboyuk1
Forum Members
Forum Members
Posts: 128
Joined: Mon Nov 26, 2018 3:09 pm

Re: SmartImage - not working for me

Post by johnboyuk1 »

Logs seem to be empty

PHP effective memory limit is as 128M
johnboyuk1
Forum Members
Forum Members
Posts: 128
Joined: Mon Nov 26, 2018 3:09 pm

Re: SmartImage - not working for me

Post by johnboyuk1 »

ok, got it i think! Explicitly set the memory limit in the config file and is working now... must have been some issue where it was showing me the incorrect figure in the system information screen

Also note as per rotezecke's comment, the url does requite the leading slash

so /uploads/images/etc

not uploads/images/etc
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1256
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: SmartImage - not working for me

Post by DIGI3 »

Just a personal preference, I like to use {uploads_url} rather than hardcoding the path, just in case it ever changes for some reason. You'll also never forget the slash in that case as it's the full url. e.g. {SmartImage src="{uploads_url}/images/foo.jpg"}
Not getting the answer you need? CMSMS support options
johnboyuk1
Forum Members
Forum Members
Posts: 128
Joined: Mon Nov 26, 2018 3:09 pm

Re: SmartImage - not working for me

Post by johnboyuk1 »

Great - good tip thanks!
User avatar
rotezecke
Power Poster
Power Poster
Posts: 398
Joined: Fri Apr 18, 2008 9:34 pm
Location: Nimbin, Australia

Re: SmartImage - not working for me

Post by rotezecke »

Could you elaborate on "Explicitly set the memory limit in the config file" please?
I am having the same experience, no output, no error. thats a straight conversion from CGSmartImage to SmartImage. The former works fine, the latter does not (regardless of path). Thanks
johnboyuk1
Forum Members
Forum Members
Posts: 128
Joined: Mon Nov 26, 2018 3:09 pm

Re: SmartImage - not working for me

Post by johnboyuk1 »

sure, even though my system info said the memory was set at 128M ... i think that may have been some kind of glitch as it wasn't until i set the memory on the config file it started working. So in your config file, add this line:

Code: Select all

ini_set("memory_limit", "128M");
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1256
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: SmartImage - not working for me

Post by DIGI3 »

Best to use specific terms, "config file" to most cmsms users means config.php but that looks like it's from your php.ini or user.ini file.
Not getting the answer you need? CMSMS support options
Post Reply

Return to “Modules/Add-Ons”