Page 14 of 33
Re: Announcement: New plug-in SuperSizer
Posted: Tue Mar 23, 2010 3:13 pm
by JeremyBASS
well may-be I can add some math that says, files size x estimated process constant /php mem limit < 1 equals true... then not process the image, go to the pass-through with an error. This would do one thing thou, it'd be running every time till the error is taken care of. Otherwise it only takes the time the first time.
May-be I can just infer this state without the math but atm I can’t think of a way... The issue is that when the error occurs, the reason for the head dropping out as you saw was that everything stopped processing, and with that I can't pass an error after the failed image processing due to lack of memory.. I have to predict the fail state. I'll see what I can think of... May-be I'm over thinking it...
Cheers -Jeremy
Re: Announcement: New plug-in SuperSizer
Posted: Tue Mar 23, 2010 5:02 pm
by opawaldburger
Hi!
Great feature, which I want to use in the News Module. To every article, there is a photo shown. Therefore I've set a custom field which is called image_1 and that's how I used to implement it in my site:
Code: Select all
<img src="{$entry->file_location}/{$entry->image_1}" />
How am I gonna do that with SuperSizer? Tried it this way, but it didn't work:
Code: Select all
{assign var=image_1 value=$entry->image_1}
{assign var=location value=$entry->file_location}
{supersizer path='$location/$image_1' width='150' height='150' style='border: 3px solid #06609f; width: 150px; height:150px; margin: 18px 10px 0 0;' }
Greez,
Opa
Re: Announcement: New plug-in SuperSizer
Posted: Thu Mar 25, 2010 11:12 am
by NikNak
Hi Jos
I'm still a bit stuck on this URLencode mod of gallery as in my earlier post so that it can work with supersizer.
Are you able to set me in the right direction as to which lines of code I should be looking to URLencode in the Gallery module?
Much obliged if you can help.
Nik
Re: Announcement: New plug-in SuperSizer
Posted: Thu Mar 25, 2010 11:36 am
by Jos
I took a quick look in the forge and in file
action.default.php (rev 72) you'll find the line
Code: Select all
$rec->file = DEFAULT_GALLERY_PATH . str_replace('%2F','/',rawurlencode($key));
So there is already a rawurlencode in it. I didn't look back when I introduced this, but it must be there for some reason (bug report?) Do you have this in your code also?
You could try to replace that code with
Code: Select all
$rec->file = DEFAULT_GALLERY_PATH . $key;
and see what happens
Re: Announcement: New plug-in SuperSizer
Posted: Thu Mar 25, 2010 4:07 pm
by porridj
hmmm... I thought it was the larger file that was the problem, however, it appears as though it is not that...possibly something to do with cmyk/rgb or something. i cant look into it properly at the moment to give you a better diagnostic as i leave my job tomorrow and have shed loads to do.it was wiping out the again with a 500k image when the memory limit was set to 10...unless heart have some kind of limit which I cant control?
i am using the supersizer about 10 times on one page...that is probably the problem...so i can have as many photos as i like, up to a certain size? does that help?
Re: Announcement: New plug-in SuperSizer
Posted: Thu Mar 25, 2010 4:09 pm
by porridj
...upped the memory limit to 60M and it worked, I didnt realise the supersizer would need the total memory of all the files its referencing put together...makes total sense in hindsight though.
Hope this helps other daft people like myself

Re: Announcement: New plug-in SuperSizer
Posted: Thu Mar 25, 2010 4:26 pm
by NikNak
Hi Jos
That worked and so did replacing the line with:
$rec->file = DEFAULT_GALLERY_PATH . str_replace('%2F','/',str_replace('%20',' ',rawurlencode($key)));
ie replacing the %20 as well as the %2F
Do you think this could be accommodated in your next update?
Many thanks for your help
Nik
Re: Announcement: New plug-in SuperSizer
Posted: Thu Mar 25, 2010 4:30 pm
by Jos
Yeah sure, if it doesn't raise any other issues...
Could you try a imagename with a single quote ' in it?
edit:
And with a ( or ) using the slimbox template? I guess this bugreport
http://dev.cmsmadesimple.org/bug/view/4001 made me add the rawurlencode
Re: Announcement: New plug-in SuperSizer
Posted: Thu Mar 25, 2010 5:31 pm
by JeremyBASS
Ok.. I have not read through the code but... seems to me that this is what should be there?
$rec->file = DEFAULT_GALLERY_PATH . rawurldecode($key);
if you have to replace '%2F' or '%20' I'd think that you may run into issues with others.. But like I said I have not read any of the code...
@NikNak there is a post much lower.. like page 10/4 sort depending or something like that.. that shows how to work around this for the time being..
Hope this helps .. cheers -Jeremy
miny gallery based on SuperSizer/Gallery
Posted: Wed Mar 31, 2010 3:36 pm
by JeremyBASS
I'll expand on this later.. but it's a miny gallery which links to the full gallery...
{assign var=Files value="uploads/images/Gallery/[!^thumb_]*.*"|glob}
{foreach from=$Files item='File' name="" name=foo}
{if $smarty.foreach.foo.index"}
{/if}
{/foreach}
Cheers -Jeremy
Re: Announcement: New plug-in SuperSizer
Posted: Thu Apr 01, 2010 12:15 pm
by nicmare
jeremy, thank you very much for this awesome plugin. would you be so kind and update your very first post? last update was on 23 Dec 2009. and i assume you added some new features which are not included in the first post?! and did not follow every post here. THANKS
Re: Announcement: New plug-in SuperSizer
Posted: Thu Apr 01, 2010 3:39 pm
by JeremyBASS
oh.. dang.. I've been so under water with work.. it's on my list.. but the major new one is the overwirte param.. now you can overwrite the original which is good to make a udt and attach it to an event and size images on upload... ect..

I still need to release it lol.. gosh I'm behind.. didn't help that I had a raid crash yesterday... -J
Re: Announcement: New plug-in SuperSizer
Posted: Fri Apr 02, 2010 9:24 pm
by opawaldburger
Hey!
Since no one answered me so far and I don't think that nobody has a clue how to solve this problem I dare posting my post again

Would be lovely if anyone has got a similar problem or a guess!
Greez Opa
opawaldburger wrote:
Hi!
This is a great feature, which I want to use with the News Module. Next to every article there is a photo shown (already, but so far with a big resolution).
So far I've set a custom field which is called image_1 and implemented it this way in my site:
Code: Select all
<img src="{$entry->file_location}/{$entry->image_1}" />
How am I gonna do that with SuperSizer? Tried it this way, but it didn't work:
Code: Select all
{assign var=image_1 value=$entry->image_1}
{assign var=location value=$entry->file_location}
{supersizer path='$location/$image_1'}
Greez,
Opa
Re: Announcement: New plug-in SuperSizer
Posted: Sat Apr 03, 2010 1:13 am
by JeremyBASS
Hi there.. Really you have to do the trouble shooting there.. But this is how..
{assign var=image_1 value=$entry->image_1}
{assign var=location value=$entry->file_location}
{supersizer path='$location/$image_1'}
What does {$image_1} output? {$location}
What is outputting with {supersizer path='$location/$image_1'} .. stet... you can't use {supersizer path='$location/$image_1'} the ' does let the var process.. use {supersizer path="$location/$image_1"} try that with the dbl quote... there is at least 4-6 people in this post alone that have posted code for news and have it working so that is mostly like it... HTH cheers -J
Re: Announcement: New plug-in SuperSizer
Posted: Sat Apr 03, 2010 9:22 am
by opawaldburger
Hi Jeremy!
I have an excuse

I didn't look trough every post here so I used the search, which didn't show me a single post concerning "SuperSizer News". So I thought that there might be none... Thanks for you help so far
Anyhow, I used this method now:
Code: Select all
{capture assign="imgurl"}{$entry->file_location}/{$entry->image_1}{/capture}
{capture assign="imgloc"}news/id{$entry->id}{/capture}
{supersizer path="$imgurl" Subdir="$imgloc" Quality=90 width="150" height="150" style="border: 3px solid #06609f; margin: 18px 10px 0 0;"}
But somehow there's always this error appearing:
Code: Select all
Warning: Invalid argument supplied for foreach() in /srv/www/vhosts/benjamin-karl.com/httpdocs/plugins/function.supersizer.php on line 459
Where's the mistake?
Greez, Opa