Page 25 of 33
Re: Announcement: New plug-in SuperSizer
Posted: Tue Aug 03, 2010 7:16 pm
by JeremyBASS
what is the $config['root_path'] ? what is the $config['root_url']...
I think the issue starts with where is yurl.myhost.org coming from on the
There is a path issue with the orginal image!
Does this look right?
Path:/home/www/myurl.myhost.org/htdocs/yurl.myhost.org/uploads/Availability/resources_1/thumb_346.jpg
as I'm betting your real path is /home/www/myurl.myhost.org/htdocs/uploads/Availability/resources_1/thumb_346.jpg
subdomain or not it shuold not matter... the code below checks for http then gets the length of the $config['root_url'] if match is found and then replaces from the start of the string to the end of the root url.
Let start by find out what your paths are.. as this is well tested and should work, and both NikNak and kendo451 confirmed it.. :/
Code: Select all
if($strip_tags){
if (preg_match('#<(.*?)src="(.*?)"(.*?)/>#', $path, $matches)) {$path = $matches[2];}
if ((substr($path, 0,5))=="https"){$L=strlen($config['ssl_url']);$path = substr_replace($path, '', 0, $L);}
if ((substr($path, 0,4))=="http"){$L=strlen($config['root_url']);$path = substr_replace($path, '', 0, $L);}
$matches = array();
if (preg_match('#[http|https]://(.*?)/(.*?)#', $path, $matches)) {$path = $matches[0];}
}
Re: Announcement: New plug-in SuperSizer
Posted: Tue Aug 03, 2010 7:40 pm
by nicmare
yes, my real path is
Code: Select all
$config['image_uploads_path'] = '/home/www/myurl.myhost.org/htdocs/uploads/images';
and i have no idea why your script assumes it is
Code: Select all
Path:/home/www/myurl.myhost.org/htdocs/yurl.myhost.org/uploads/Availability/resources_1/thumb_346.jpg
some more info from config.php:
Code: Select all
$config['root_url'] = 'http://myurl.myhost.org';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}
Code: Select all
$config['root_path'] = '/home/www/myurl.myhost.org/htdocs';
Re: Announcement: New plug-in SuperSizer
Posted: Wed Aug 04, 2010 8:53 am
by nicmare
ive tested it also in another module (gallery) and it works fine…
{supersizer path=$image->thumb width="100"}
Re: Announcement: New plug-in SuperSizer
Posted: Wed Aug 04, 2010 3:25 pm
by JeremyBASS
That is not comforting

lol .. I'll have to try to reproduce it.. I don't see why it's failing.. I'll try hopfully later today and get back.. for the time being you can do one of two things.. a
$file_location|replace:'yurl.myhost.org/':''
or just hard code it.. Cheers for now
Re: Announcement: New plug-in SuperSizer
Posted: Wed Aug 04, 2010 3:35 pm
by nicmare
JeremyBASS wrote:
$file_location|replace:'yurl.myhost.org/':''
well, surprisingly this works! i dunno why but i am happy with this

. thank you
Re: Announcement: New plug-in SuperSizer
Posted: Wed Aug 04, 2010 11:45 pm
by stainless
nicmare wrote:
JeremyBASS wrote:
$file_location|replace:'yurl.myhost.org/':''
well, surprisingly this works! i dunno why but i am happy with this

. thank you
I had the same problem, with path, I turn back to previous version of supersizer and it's working fine...it adds a domain name in somewhere in the server path...
Re: Announcement: New plug-in SuperSizer
Posted: Fri Aug 06, 2010 6:03 pm
by JeremyBASS
Ok.. um .. I don't know why I didn't see this before..
@nicmare you don't have strip_tags=true in your tag.. adding that will fix the issue...
nicmare wrote:
i am using the last supersizer version with CMSms 1.6.7 and availbility module 1.7.11.
i call a custom field (type=image) like this:
Code: Select all
<img src="{$file_location}/{$rsrc.fields.myimage.value}" alt="{$rsrc.name}" />
which works pretty good. but now i want to thumbnail it with supersizer, therefore i tried it this way:
Code: Select all
{assign var=imagethumb value=`$file_location`/`$rsrc.fields.myimage.value`}
{supersizer path=$imagethumb width="100"}
and
Code: Select all
{capture assign=imagethumb}{$file_location}/{$rsrc.fields.myimage.value}{/capture}
.
@stainless I'm betting the same...
Also I'll be changing this that does strip the extra that modules will put on.. you can try it if you think after putting the strip_tags=true in your tag and are still having issue..
Replace
Code: Select all
if($strip_tags){
if ((substr($path, 0,5))=="https"){$L=strlen($config['ssl_url']);$path = substr_replace($path, '', 0, $L);}
if ((substr($path, 0,4))=="http"){$L=strlen($config['root_url']);$path = substr_replace($path, '', 0, $L);}
if (preg_match('#<(.*?)src="(.*?)"(.*?)/>#', $path, $matches)) {
$path = $matches[2];
}
}
with
Code: Select all
if($strip_tags){
if ((substr($path, 0,5))=="https"){$L=strlen($config['ssl_url']);$path = substr_replace($path, '', 0, $L);}
if ((substr($path, 0,4))=="http"){$L=strlen($config['root_url']);$path = substr_replace($path, '', 0, $L);}
if (preg_match('#<(.*?)src="(.*?)"(.*?)/>#', $path, $matches)) {
$path = $matches[2];
}
}
Re: Announcement: New plug-in SuperSizer
Posted: Mon Aug 16, 2010 3:27 am
by JeremyBASS
@nicmare or @stainless .. So is this still in issue? I can't for the life of me reproduce it... any edit I'd do would be blind.. tk -J
Re: Announcement: New plug-in SuperSizer
Posted: Mon Aug 16, 2010 9:50 am
by nicmare
sorry jeremy, was in vacations… adding strip_tags=true works fine for me! thank you! but i dont really understand why this is neccessary. because i just thought i need it when i have instead of path only.
Re: Announcement: New plug-in SuperSizer
Posted: Mon Aug 16, 2010 2:08 pm
by JeremyBASS
The reason why it's necessary is that every module seems to have a different rhyme or reason on the way they out put the url so I needed to add a few more line just to handle the correction, and strip_tags was the best place instead of a new param. Thank for getting back .. cheers -Jeremy
Re: Announcement: New plug-in SuperSizer
Posted: Thu Aug 19, 2010 2:47 pm
by nicmare
its me again! this time i want to use Supersizer with calendar.
first of all: i use it at different places.
so for my summary of upcoming events i display my thumbnail this way:
Code: Select all
{capture assign=imgpath}{root_url}/uploads/calendar/{$event.fields.Flyer}{/capture}
{supersizer width="210" height="120" path=$imgpath alt="Preview" strip_tags="true"}
this works pretty nice.
now, i want to use it in event detail template. therefore i copied the snippet and pasted it in same place. this works too. but when i change the dimension. for example to:
Code: Select all
{capture assign=imgpath}{root_url}/uploads/calendar/{$event.fields.Flyer}{/capture}
{supersizer width="650" path=$imgpath alt="Image" strip_tags="true"}
i get no error but also no image. The path to the image in the source code looks like this:
Code: Select all
<img src="http://www.domain.com/uploads/SuperSizerTmp/1280761591.-w650-h0-p0-q85-F-----S1-c.jpg?" alt="" />
whats wrong here? there also isnt an image of 650px width in the upload path. just the small one from summary template.
debug output:
Code: Select all
SuperSizer Object
(
[strOriginalImagePath] => /www/htdocs/w00cf148/uploads/calendar/1280761591.jpg
[strResizedImagePath] => /www/htdocs/w00cf148/uploads/SuperSizerTmp/1280761591.-w650-h0-p0-q85-F-----S1-c.jpg
[arrOriginalDetails] => Array
(
[0] => 619
[1] => 275
[2] => 2
[3] => width="619" height="275"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)
[arrResizedDetails] => Array
(
[0] => 619
[1] => 275
[2] => 2
[3] => width="619" height="275"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)
[resOriginalImage] => Resource id #130
[resResizedImage] =>
[errors] =>
[boolProtect] => 1
)
<h2 class="title">Original Image</h2><pre>Array
(
[0] => 619
[1] => 275
[2] => 2
[3] => width="619" height="275"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)
</pre><h2 class="title">Resized Image</h2><pre>Array
(
[0] => 619
[1] => 275
[2] => 2
[3] => width="619" height="275"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)
</pre>
EDIT: Maybe i found the reason why:
the uploaded image is 619px wide. and i wanted it to be 650 wide. if i change the supersizer width to 610, it works. maybe a errormessage would be nice? or even the output of the source image instead
Re: Announcement: New plug-in SuperSizer
Posted: Thu Aug 19, 2010 6:55 pm
by JeremyBASS
nicmare wrote:
EDIT: Maybe i found the reason why:
the uploaded image is 619px wide. and i wanted it to be 650 wide. if i change the supersizer width to 610, it works. maybe a errormessage would be nice? or even the output of the source image instead
Hello, what you can do is two thing, turn off the protection so it'll scale up.. or .. you can use the passthru param to show the original. Both have their uses ie: protection can be used to insert a default "too low" image etc.. Hope that clears it up a little.. Glad it's getting used and tested but good..

Cheers –jeremy
Re: Announcement: New plug-in SuperSizer
Posted: Wed Sep 15, 2010 9:46 am
by uniqu3
Hi Jeremy,
i have bumped in an issue that for some reason i cannot solve

What i am playing with:
I am not flash fan but i wanted to play around with integration of Piecemaker slider (cu3er alternative)
http://www.modularweb.net/piecemaker/ and combining it with News module.
So far so good i have News summary template, CGFeedmaker with xml for the script and Supersizer for the images.
In xml i only need to output the image name like (i tried it with url, but didn't work) and this is why i tried using Supersizer for this task.
The problem:
I couldn't figure out if Supersizer could output only image name without path so i decided for the from= and to= method and got it working on my WAMP installation but on the demo site i just can't get it to work and it seems that unique='false' or unique='true' doesn't work for me either, the output is allways the same.
What i did:
{foreach from=$items item='entry'}
{assign var=id value=$entry->id}
{assign var=image value=$entry->nimage}
{supersizer path="uploads/news/id$id/$image" unique='true'}
{supersizer from="uploads/news/id$id/$image" to="uploads/slider"}
{/foreach}
Now my demo page:
http://demo.i-arts.eu/piecemaker
As you can see the first supersizer call works just fine, the second gives me error
Warning: imagejpeg() [function.imagejpeg]: Unable to open '/www/htdocs/w0085095/demo/uploads/slider' for writing: Is a directory in /www/htdocs/w0085095/demo/plugins/function.supersizer.php on line 259
I have also tried using to='uploads/SuperSizerTmp' folder which i know is writable as you can see images are written there but i got the same error.
Re: Announcement: New plug-in SuperSizer
Posted: Wed Sep 15, 2010 10:37 am
by nicmare
what is {assign var=image value=$entry->nimage} ?
Re: Announcement: New plug-in SuperSizer
Posted: Wed Sep 15, 2010 10:41 am
by uniqu3
nimage is News extra field, i know the name is stupid but it was meant for testing
