Announcement: New plug-in SuperSizer
Re: Announcement: New plug-in SuperSizer
Ok new version is published... 0.9 I think is close for a full alpha release.. Let me know if there is issues.. Cheers
Jeremy
Jeremy
Re: Announcement: New plug-in SuperSizer
Wow, I feel absolutely stupid now. The only mistake I did was using SINGLE quotes instead of DOUBLE quotes in the widthIS-var all the time, I can't believe I haven't noticed this before.. 
Thanks alot for your help and pointing me into the right direction! Here's the whole code-bit I've used, just in case someone else needs a quick copy/paste:
News detailtemplate with a custom field for image upload, limited to 300px width, smaller images do not get resized:

Thanks alot for your help and pointing me into the right direction! Here's the whole code-bit I've used, just in case someone else needs a quick copy/paste:
News detailtemplate with a custom field for image upload, limited to 300px width, smaller images do not get resized:
Code: Select all
{assign var=newsid value=$entry->id}
{assign var=newsimg value=$entry->newsimage}
{assign var=widthIS value="uploads/news/id$newsid/$newsimg"|getimagesize}
{if $widthIS[0]>'300'}
{supersizer path="uploads/news/id$newsid/$newsimg" width='300' alt=""}
{else}
<img src="uploads/news/id{$entry->id}/{$entry->newsimage}" alt="" />
{/if}
Re: Announcement: New plug-in SuperSizer
I think you can leave the quotes out for numbers.
-
- Forum Members
- Posts: 20
- Joined: Tue Jul 07, 2009 5:29 am
Re: Announcement: New plug-in SuperSizer
Hello there-
I feel really dumb, but I downloaded the new plug-in "SuperSizer" and I want it simply to resize the images which will be uploaded to the "Gallery" module. Often times, what happens is I tend to upload pictures directly from my camera, some which are like 4 or 5mb, which is too big for the gallery.
Will this tag support this? From what I read, it appears too.
How do I install the tag to my site?
Thanks.
I feel really dumb, but I downloaded the new plug-in "SuperSizer" and I want it simply to resize the images which will be uploaded to the "Gallery" module. Often times, what happens is I tend to upload pictures directly from my camera, some which are like 4 or 5mb, which is too big for the gallery.
Will this tag support this? From what I read, it appears too.
How do I install the tag to my site?
Thanks.
Re: Announcement: New plug-in SuperSizer
Yes it will as long as you server can support the large files being processed... as for install just put the file in your plugins folder... hth Cheers -JeremyBass
-
- Forum Members
- Posts: 20
- Joined: Tue Jul 07, 2009 5:29 am
Re: Announcement: New plug-in SuperSizer
Jeremy-
Thanks for the help. I have another Question..I am using the Gallery module with the lightbox template. How would I include the Supersizer plugin to modify the original uploaded images to a standard width and height?
Lightbox code for Gallery-
---------------------------------
{if !empty($module_message)}{$module_message|escape}{/if}
{if !empty($gallerytitle)}{$gallerytitle}{/if}
{if !empty($gallerycomment)}{$gallerycomment}{/if}
{if $pages > 1}
{$prevpage}
{$nextpage}
{/if}
{if !$hideparentlink && !empty($parentlink)}{$parentlink}{/if}
{if $pages > 1}{$pagelinks}{/if}
{foreach from=$images item=image}
{if $image->isdir}
file}" title="{$image->title}">thumb}" alt="{$image->title}" />
{$image->title}
{else}
file}" title="{$image->title}" rel="lightbox[gallery]">thumb}" alt="{$image->title}" />
{/if}
{/foreach}
Thanks for the help. I have another Question..I am using the Gallery module with the lightbox template. How would I include the Supersizer plugin to modify the original uploaded images to a standard width and height?
Lightbox code for Gallery-
---------------------------------
{if !empty($module_message)}{$module_message|escape}{/if}
{if !empty($gallerytitle)}{$gallerytitle}{/if}
{if !empty($gallerycomment)}{$gallerycomment}{/if}
{if $pages > 1}
{$prevpage}
{$nextpage}
{/if}
{if !$hideparentlink && !empty($parentlink)}{$parentlink}{/if}
{if $pages > 1}{$pagelinks}{/if}
{foreach from=$images item=image}
{if $image->isdir}
file}" title="{$image->title}">thumb}" alt="{$image->title}" />
{$image->title}
{else}
file}" title="{$image->title}" rel="lightbox[gallery]">thumb}" alt="{$image->title}" />
{/if}
{/foreach}
Re: Announcement: New plug-in SuperSizer
It's lower in this post somewhere.. I'd have to bring up one the sites to make the example.. so I could do that later if need. Cheers - jeremyBass
Re: Announcement: New plug-in SuperSizer
ctrujillo45 look at what luki has done here http://forum.cmsmadesimple.org/index.ph ... #msg194072
that applies to the second {$image->file} , the one after the {else} statement in the foreach loop.
that applies to the second {$image->file} , the one after the {else} statement in the foreach loop.
-
- Forum Members
- Posts: 20
- Joined: Tue Jul 07, 2009 5:29 am
Re: Announcement: New plug-in SuperSizer
Hello there-
The previous person said they were using Fancybox...I am using Lightbox and I can't figure out how get this tag to work.
I replaced this:
{if !empty($module_message)}{$module_message|escape}{/if}
{if !empty($gallerytitle)}{$gallerytitle}{/if}
{if !empty($gallerycomment)}{$gallerycomment}{/if}
{if $pages > 1}
{$prevpage}
{$nextpage}
{/if}
{if !$hideparentlink && !empty($parentlink)}{$parentlink}{/if}
{if $pages > 1}{$pagelinks}{/if}
{foreach from=$images item=image}
{if $image->isdir}
file}" title="{$image->title}">thumb}" alt="{$image->title}" />
{$image->title}
{else}
file}" title="{$image->title}" rel="lightbox[gallery]">thumb}" alt="{$image->title}" />
{/if}
{/foreach}
With this:
{if !empty($module_message)}{$module_message|escape}{/if}
{if !empty($gallerytitle)}{$gallerytitle}{/if}
{if !empty($gallerycomment)}{$gallerycomment}{/if}
{if $pages > 1}
{$prevpage}
{$nextpage}
{/if}
{if !$hideparentlink && !empty($parentlink)}{$parentlink}{/if}
{if $pages > 1}{$pagelinks}{/if}
{foreach from=$images item=image}
{if $image->isdir}
file}" title="{$image->title}">thumb}" alt="{$image->title}" />
{$image->title}
{else}
file width="800" URL="true" }" title="{$image->title}" rel="lightbox[gallery]">thumb}" alt="{$image->title}" />
{/if}
{/foreach}
------------------------------
What am I doing wrong? Is is the lightbox link that is not enabling this tag to work? It when I click on the thumbnail, the image does not load. The lightbox just stays white....like it's searching for the image.
The previous person said they were using Fancybox...I am using Lightbox and I can't figure out how get this tag to work.
I replaced this:
{if !empty($module_message)}{$module_message|escape}{/if}
{if !empty($gallerytitle)}{$gallerytitle}{/if}
{if !empty($gallerycomment)}{$gallerycomment}{/if}
{if $pages > 1}
{$prevpage}
{$nextpage}
{/if}
{if !$hideparentlink && !empty($parentlink)}{$parentlink}{/if}
{if $pages > 1}{$pagelinks}{/if}
{foreach from=$images item=image}
{if $image->isdir}
file}" title="{$image->title}">thumb}" alt="{$image->title}" />
{$image->title}
{else}
file}" title="{$image->title}" rel="lightbox[gallery]">thumb}" alt="{$image->title}" />
{/if}
{/foreach}
With this:
{if !empty($module_message)}{$module_message|escape}{/if}
{if !empty($gallerytitle)}{$gallerytitle}{/if}
{if !empty($gallerycomment)}{$gallerycomment}{/if}
{if $pages > 1}
{$prevpage}
{$nextpage}
{/if}
{if !$hideparentlink && !empty($parentlink)}{$parentlink}{/if}
{if $pages > 1}{$pagelinks}{/if}
{foreach from=$images item=image}
{if $image->isdir}
file}" title="{$image->title}">thumb}" alt="{$image->title}" />
{$image->title}
{else}
file width="800" URL="true" }" title="{$image->title}" rel="lightbox[gallery]">thumb}" alt="{$image->title}" />
{/if}
{/foreach}
------------------------------
What am I doing wrong? Is is the lightbox link that is not enabling this tag to work? It when I click on the thumbnail, the image does not load. The lightbox just stays white....like it's searching for the image.
Re: Announcement: New plug-in SuperSizer
ok.. so {supersizer path=$image->file width="800" URL="true" } looks fine.. but try this...
{supersizer path=$image->file width=800 URL=true Protect=false}
I bet the image is smaller than the size you’re calling... This is usually the issue since Protect is defaulted to true
Hope this helps
Cheers
JeremyBass
... just incase anyone is wondering.. the JeremyBass bold like it is, an SEO experiment
{supersizer path=$image->file width=800 URL=true Protect=false}
I bet the image is smaller than the size you’re calling... This is usually the issue since Protect is defaulted to true
Hope this helps
Cheers
JeremyBass
... just incase anyone is wondering.. the JeremyBass bold like it is, an SEO experiment

-
- Forum Members
- Posts: 20
- Joined: Tue Jul 07, 2009 5:29 am
Re: Announcement: New plug-in SuperSizer
Yes, that resolved the problem. Thanks!
Last question: I noticed what the tag does is it retains the original image and creates a sub-directory called "SuperSizer Tmp"...is there a way to eliminate the original image on the fly and only utilize the converted image? Or better yet, why couldn't the tag save the image with the same name and overwrite the existing?
The problem is I don't want to keep these large images on my server or else I may get charged more for monthly hosting. I want to get rid of the large (file size) image.
Last question: I noticed what the tag does is it retains the original image and creates a sub-directory called "SuperSizer Tmp"...is there a way to eliminate the original image on the fly and only utilize the converted image? Or better yet, why couldn't the tag save the image with the same name and overwrite the existing?
The problem is I don't want to keep these large images on my server or else I may get charged more for monthly hosting. I want to get rid of the large (file size) image.
Re: Announcement: New plug-in SuperSizer
Well you can go in and delete them but.. And this is the reason why.. What if you clear the cache.. ? Then you would get errors because there is nother for supersizer to size... so that is why I will not be adding anything that kills off the original.. it'll just lead people in to trouble.. This also is what give it the flexibility to work with any mod you want to use this with... sorry I can't help you there..
Glad you got it working.. Cheers
jeremyBass
Glad you got it working.. Cheers
jeremyBass
Re: Announcement: New plug-in SuperSizer
Interesting thought. You could do what you want in a "wrapper" UDT. It shouldn't take much effort. For single image files, just overwrite the original file contents with the cached file contents after a successful supersizer call. This would consume 2 times the cached file size, but that should be better than it was.ctrujillo45 wrote: ... Or better yet, why couldn't the tag save the image with the same name and overwrite the existing?
...
That said, if you wanted to use the minimum file space -- that required by the cached version alone -- then you could try using filesystem hard links, assuming your server filesystem+permissions support them. I suspect, however, that it would be better to do this from inside supersizer to handle whole directories more efficiently. I can post more details, if that would be helpful.
Cheers,
Fred P.
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
- Abraham Lincoln
Re: Announcement: New plug-in SuperSizer
I guess in order for anything like this to occur a pass thou would need to be made first.. ie if not resized and no cached file then the original is served straight... I figured that people would just use smarty logic to handle this and is why it's not there.. but if there was to be any hope for supersizer to write to the original file.. the pass thru would have to be done first...
I guess after thinking on this... I think I will add an over write, but it will not be right away since to add the pass thru part would require some heavy tweaking to the class.
I'll see what I can do.. Cheers jeremyBass
what params will need to be added..
minWidth
minHeight
passthru
overwrite
I guess after thinking on this... I think I will add an over write, but it will not be right away since to add the pass thru part would require some heavy tweaking to the class.
I'll see what I can do.. Cheers jeremyBass
what params will need to be added..
minWidth
minHeight
passthru
overwrite
Last edited by JeremyBASS on Wed Jan 27, 2010 4:13 pm, edited 1 time in total.
Re: Announcement: New plug-in SuperSizer
I just played around with your plugin and i love it! 
I'm using it to create thumbnails on the fly.
But i realized that you're using image transform functions that are only available if php comes bundeled with GD libary.
(E.g. imageantialias())
If GD libary is running as an apache module you will get the error message "Call to undefined function imageantialias()".
(users need to recompile php with GD to make it working)
Since not every user owns a server it would be nice first to check if those functions exists before using them, e.g:
It also would be nice to be able to suppress the error message that there has been a path issue.
If the image does not exist i simply would like to see no image or a dummy picture or just an inline div with the measure of the picture and a tiny hint that the image hasn't been found.
And last not least it would be nice to tell the SuperSizer to use the CMSms tmp directory instead of the uploads directory.
Anyway cool stuff.

I'm using it to create thumbnails on the fly.
But i realized that you're using image transform functions that are only available if php comes bundeled with GD libary.
(E.g. imageantialias())
If GD libary is running as an apache module you will get the error message "Call to undefined function imageantialias()".
(users need to recompile php with GD to make it working)
Since not every user owns a server it would be nice first to check if those functions exists before using them, e.g:
Code: Select all
if(function_exists('imageantialias'))
imageantialias($this->resResizedImage, true);
If the image does not exist i simply would like to see no image or a dummy picture or just an inline div with the measure of the picture and a tiny hint that the image hasn't been found.
And last not least it would be nice to tell the SuperSizer to use the CMSms tmp directory instead of the uploads directory.
Anyway cool stuff.
Last edited by NaN on Thu Jan 28, 2010 1:01 am, edited 1 time in total.