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 »

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];}
	}
Last edited by JeremyBASS on Tue Aug 03, 2010 7:18 pm, edited 1 time in total.
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: Announcement: New plug-in SuperSizer

Post 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';
Last edited by nicmare on Tue Aug 03, 2010 7:57 pm, edited 1 time in total.
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: Announcement: New plug-in SuperSizer

Post by nicmare »

ive tested it also in another module (gallery) and it works fine…
{supersizer path=$image->thumb width="100"}
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post by JeremyBASS »

That is not comforting :D 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
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: Announcement: New plug-in SuperSizer

Post 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
stainless
Forum Members
Forum Members
Posts: 27
Joined: Wed Apr 16, 2008 9:04 pm

Re: Announcement: New plug-in SuperSizer

Post 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...
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post 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]; 
		}
	}

Last edited by JeremyBASS on Fri Aug 06, 2010 6:12 pm, edited 1 time in total.
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post 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
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: Announcement: New plug-in SuperSizer

Post 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.
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post 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
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: Announcement: New plug-in SuperSizer

Post 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
Last edited by nicmare on Thu Aug 19, 2010 2:55 pm, edited 1 time in total.
JeremyBASS

Re: Announcement: New plug-in SuperSizer

Post 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.. :D Cheers –jeremy
uniqu3

Re: Announcement: New plug-in SuperSizer

Post 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.
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: Announcement: New plug-in SuperSizer

Post by nicmare »

what is {assign var=image value=$entry->nimage} ?
uniqu3

Re: Announcement: New plug-in SuperSizer

Post by uniqu3 »

nimage is News extra field, i know the name is stupid but it was meant for testing  :)
Locked

Return to “Modules/Add-Ons”