Announcement: New plug-in SuperSizer

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post by JeremyBASS »

NikNak wrote: ...
The debug gives this - but outputs no image. I also tried the striptags  with path=$pic but that really messed the path up.
....
I know you said you tried striptags  .. did you use it that way?  It'd be strip_tags ... I did update the wiki here with the new params that would go with the last posted version, thou they have not changed for a few version but they don't match the ones from the last publish version...

http://wiki.cmsmadesimple.org/index.php ... it_take.3F

Let me know if that solves it.. and side not, thou it should make a diff you have crop in twice.  Cheers -Jeremy
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post by JeremyBASS »

oh I see, you have "URL".. switch that to "url"  that will make a diff on some servers.  In the new params all are lower case and many are the lined up with the rest of cmsms in things like the strip_tags etc so one would have to remember less.. I'd defiantly cross reference the wiki but I bet fixing the URL to url will solve it.. Cheers -Jeremy
User avatar
NikNak
Forum Members
Forum Members
Posts: 183
Joined: Fri Oct 02, 2009 2:28 pm

Re: Announcement: New plug-in SuperSizer

Post by NikNak »

Thanks Jeremy - I noticed the URL in caps too - so it now produces images thanks.

However, it doesn't seem to scale the image automatically to fit the new size now.
{supersizer path=$pic width='190'  height='95' url=true protect=0  crop="center,center"}
The above, now crops in on the image without scaling to fit first.  I see there is a scale parameter in addition to the crop, but to accurately scale to fill the desired space would require calculating the sizes outside of supersizer.

Is this something to do with the 'fit' parameter? there is no explanation for this on the wiki, and it doesn't seem to make a difference.

ps, I have tried the different crop parameters, and cant get the supersized image to change - only after deleting the cache does the image get re-generated.

Kind regards

Nik
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post by JeremyBASS »

hmm.. I'll have to think on the this in regards to the re-generated part as it's done via the name to know it needs to be, or a new original image's uploaded time.. but I'll take care of that..

On the fit.. that should have worked.. I think I just need to look, I may have forgot to do the crop fix to the fit routine there.. I'll get back there later today..
kendo451

Re: Announcement: New plug-in SuperSizer

Post by kendo451 »

Hey NikNak,

The problem is your tag syntax:
using:{supersizer path=$pic|replace:$gCms->config.root_url:'' width='190'  height='95' URL=true protect=0 crop='true' subdir='people' assign="thumbpic" passthru="true" quality=90 crop="center,center" debug=true }

Look at the double quotes, particularly the unmatched double quote at the end of your path= statement.

Ken
User avatar
NikNak
Forum Members
Forum Members
Posts: 183
Joined: Fri Oct 02, 2009 2:28 pm

Re: Announcement: New plug-in SuperSizer

Post by NikNak »

Thanks Ken
The double quote at the end of the path statement is actually two single quotes as part of the replace function. The others are indeed a mish mash but they still seem to work. The problem was the URL=true had 'URL' in caps whereas the params are now all lower case. It works as soon as that param is changed but the other bugs then showed.

Out of curiosity - why would it matter if some params have double quotes and some have single as long as they interpreted the same by the function? I am messy and inconsistent in this, but it has never caused issues.

The following still gives the same result:
{supersizer path='/uploads/images/portraits/name.jpg' width=190 height=95 url=1 assign='thumbpic' crop='center,center' fit=1 protect=0}

Regards
Nik
Last edited by NikNak on Sun Jul 18, 2010 8:22 am, edited 1 time in total.
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post by JeremyBASS »

NikNak wrote: Out of curiosity - why would it matter if some params have double quotes and some have single as long as they interpreted the same by the function? I am messy and inconsistent in this, but it has never caused issues.
here is the diff.. let say you have a cgblog out put or something were the image name is from an array..
so you can go
{supersizer path=$one.pic width='190'  height='95' }

but what if $one.pic didn't have the path.. you can't go

{supersizer path=/uploads/$one.pic width='190'  height='95' }
Or
{supersizer path="/uploads/$one.pic" width='190'  height='95' }
Or
{supersizer path='/uploads/$one.pic' width='190'  height='95' }

You have to go
{supersizer path="/uploads/`$one.pic`" width='190'  height='95' }

Now you should notice that I used the back ticks inside the dbl quotes.  With that you can’t do
{supersizer path='/uploads/`$one.pic`' width='190'  height='95' }

The single quote tell the system not to process, but to just take is as it is, so you would have ended up with this as the path. /uploads/`$one.pic`

Hope that make is clear.. Cheers Jeremy
NaN

Re: Announcement: New plug-in SuperSizer

Post by NaN »

{foo='$bar'} will have as value for the param named 'foo' just the string '$bar'
{foo="$bar"} will have as value for the param named 'foo' the value of the variable $bar.

Single/Double quotes just tell the smarty engine if the value should be handled as a variable or just as a string.

So {supersizer path="/uploads/$one.pic" width='190'  height='95' } should work imho.

This one {supersizer path="/uploads/`$one.pic`" width='190'  height='95' }
Is new to me.
kendo451

Re: Announcement: New plug-in SuperSizer

Post by kendo451 »

I know that, NAN.  I was pointing out what appeared to be an error in NikNak's syntax.  But it was two single quotes that looked to me like a double quote.
Last edited by kendo451 on Sun Jul 18, 2010 9:14 pm, edited 1 time in total.
kendo451

Re: Announcement: New plug-in SuperSizer

Post by kendo451 »

Jeremy, I have tested the latest version you have posted here and it still does not like to be fed full url for the path, even with strip_tags=true.

I also tested it on a site that was using your older version of supersizer with no problems, and the new version gives the same error there, so I think you broke your path parsing in the new version somehow.
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post by JeremyBASS »

@NaN  so no
So {supersizer path="/uploads/$one.pic" width='190'  height='95' } should work imho.
doesn't work and it's due to something a little more basic..
Single/Double quotes just tell the smarty engine if the value should be handled as a variable or just as a string.
This is everywhere, php etc..

Smarty need the back tick because in php you can't say var phptest="/uploads/$one.test"; it'd be  var phptest="/uploads/".$one.test;


to which the back tick tries to solve this issues where smarty can't do this..
{assign var=bar value="image.jpg"}
{assign var=foo value="uploads/".$bar}


from that  you need to go


{assign var=bar value="image.jpg"}
{assign var=foo value="uploads/`$bar`"}

here is a quick test and the output.. thru CGblogs


Code: Select all

{assign var=bar value="image.jpg"}
{assign var=foo value="uploads/".$bar}
{$foo}
<br/>__________________________<br/>
{assign var=bar value="image.jpg"}
{assign var=foo value="uploads/`$bar`"}
{$foo}
<br/>__________________________<br/>
{assign var=bar value="$event.event_created_by"}
{assign var=foo value="uploads/`$bar`"}
{$foo}
<br/>__________________________<br/>
{assign var=bar value=$event.event_created_by}
{assign var=foo value="uploads/`$bar`"}
{$foo}
where

$event.event_created_by = 3


and the ouput


"uploads/".image.jpg
__________________________
uploads/image.jpg
__________________________
uploads/Array.event_created_by
__________________________
uploads/3




the cool things is from that you can use a {{}} in smarty, just with a capture.. but that is a whole other topic... hope that clears it up a little.. that or I at least didn't muddy it more


@kendo451 I'll take a look here in a bit and she what the heck I drops and try to produce the failure.. hard to fix what you can see :D  I’ll get back here soon on that.. tk
NaN

Re: Announcement: New plug-in SuperSizer

Post by NaN »

Thanks for clarification :)
Last edited by NaN on Sun Jul 18, 2010 5:45 pm, edited 1 time in total.
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post by JeremyBASS »

ok. Check this one.. I tested to work.. can you all confirm and I'll release it.. tk -Jeremy
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post by JeremyBASS »

ok.. little dumb.. uploaded the wrong one.. it'll work but the http and https is out of order.. which mean https will not work... but I addressed that.. so if the test works it will be good.. tk -J
User avatar
NikNak
Forum Members
Forum Members
Posts: 183
Joined: Fri Oct 02, 2009 2:28 pm

Re: Announcement: New plug-in SuperSizer

Post by NikNak »

Thanks all for clarifying the quotes issue. It seems that in the cases I've been using, it hasn't made a difference, but I'd never seen the `` used before - how interesting. Slowly becoming a better coder :-)
Locked

Return to “Modules/Add-Ons”