In case it helps anyone, I just thought I’d add in how I’ve managed to create square thumbs without using phpThumb.
1/ In assets/snippets/maxigallery/css/default.css add the following to "ul.thumbs li":
width:size-you-want px;
height:size-you-want px;
overflow:hidden;
2/ In assets/snippets/maxigallery/watermark/Thumbnail.class.php, swap x and y around in line 264
What this seems to do (I think I’m right - it works anyways) is make sure that that the shortest dimension is used when the image is resized - before the swapping the x and y around the largest was being used resulting in a rectangular thumb.
The other larger dimension will then be masked by the overflow:hidden.
<?php $output = '/assets/snippets/phpthumb/phpThumb.php?src=' . $output . $options; return str_replace('&', '&', $output); ?>
<img src="[+phx:input=`[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]`:phpthumb=`&h=100&w=100&zc=1&q=95`+]" />
Hi again all,
I always believe in trying to find the answer before seeking help but I am afraid I have failed in this instance - with several hours down the drain. It seems to be that A number of the forum posts do their best to help but they are targetted at more experienced modx users. As a result, sometimes critical pieces of information are left out or certain knowledge is assumed. I still believe there is mileage in having a HOWTO section in the forum with case studies for specific requirement - step by step that are tested and proven to work.
Enter case in question - getting Phpthumb to work. The requirement is, I think fairly simple.
Allow the user to upload and then select and image. This image is then dynamically resized within the page template so the user does not need to resize the image prior to reloading. The source image remains unchanged. Now I thought this was simple and it probably is, but I cannot get it to work. So, for those who are new and equally have the same problem and to show that I have tried, here are my actions step by step.
1. Download the PHx package from http://modxcms.com/PHx-1006.html currently version 2.1.3 as I type.
2. Created a directory called "phx" in the assets/plugins directory
3. Copied all files and folders from within the Phx_2.1.3 folder into assets/plugins/phx directory - producing following structure.
assets/plugins/phx/
docs (folder)
modifiers (folder)
phx.parser.class.inc.php (file)
phx.plugin.txt (file)
4. Login to Manager
5. Navigate to Resources->Manage Resources -> Plugins
6. Create new plugin
Plugin name: PHx
3. Download the PhpThumb package from http://www.modxcms.com/phpThumb-Package-1522.html currently version 0.3 as I type.
2. and select an image from the I have downloaded PHx and installed this.
[!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &max_thumb_size=`80` &max_pic_size=`0` &pics_per_page=`16`!]
<?php $output = '/assets/snippets/phpthumb/phpThumb.php?src=' . $output . $options; return str_replace('&', '&', $output); ?>
<img src="[+phx:input=`[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]`:phpthumb=`&h=100&w=100&zc=1&q=95`+]" class="thumbnail" />
<img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" />
<img src="[+phx:input=`[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]`:phpthumb=`&h=100&w=100&zc=1&q=95`+]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" />
<?php $output = '/assets/snippets/phpthumb/phpThumb.php?src=' . $output . $options; return str_replace('&', '&', $output); ?>
<?php $output = '[(base_url)]assets/snippets/phpthumb/phpThumb.php?src=' . $output . $options; return str_replace('&', '&', $output); ?>
[!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &max_thumb_size=`80` &max_pic_size=`0` &pics_per_page=`16`!]
<li> <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[image[+maxigallery.pageinfo.id+]set]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]"> <img src="[+phx:input=`[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]`:phpthumb=`&h=100&w=100&zc=1&q=95`+]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" /> </a> <p style="width: [+maxigallery.picture_width_thumb+]px;"> [+maxigallery.picture.title:htmlent+] </p> </li>