Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hello,
I'm having problem with thumbnails - every time I upload image, it automatically creates three versions of the image - full size, thumbnail and smaller thumbnail and stores it in 'gallery' file that was automatically created by CouchCMS. (path is: uploads - image - gallery)

This is what thumbnails look like - they are basically smaller version of big image and it is not correct as thumbnails should be only selection of the image, not showing full image!
How can I do it?

Also, when I try to crop uploaded image in edit option, it does not do anything.

This is full code that I am using which was copied and paste from tutorial page of CouchCMS -

<cms:template title='Gallery' clonable='1' dynamic_folders='1' gallery='1'>

<cms:editable
name="gg_image"
label="Image"
desc="Upload your main image here"
width="500"
show_preview='1'
preview_height='200'
type="image"
/>

<cms:editable
name="gg_thumb"
assoc_field="gg_image"
label="Image Thumbnail"
desc="Thumbnail of image above"
width='200'
height='200'
enforce_max='1'
type="thumbnail"
/>

</cms:template>

Thank you for reply!

Attachments

Hello Pinky,

From the definitions of the editable regions you posted, there is only one thumbnail that should get created - the one named 'gg_thumb' (the one named 'gg_image' is the actual main image and not a thumbnail).

This 'gg_thumb' is used by Couch to show in the admin-panel gallery listing so you should not change its definition (as shown in the docs at http://www.couchcms.com/docs/concepts/p ... llery.html) i.e. leave it to 115x115.

To create your own version of thumbnail, please add one more editable region like this -
Code: Select all
<cms:editable
    name="my_thumb"
    assoc_field="gg_image"
    label="Image Thumbnail"
    desc="Second thumbnail of image above"
    width='200'
    height='200'
    type="thumbnail"
/>

In the definition above, we have *not* set 'enforce_max', and so the thumbnail will get cropped instead of getting resized, which is what you want.

Now you'd be able to use the 'Recreate cropping from' option to adjust which part of the image is used for the thumbnail.

Please see the docs on 'thumbnail' for how it works - http://www.couchcms.com/docs/tags-refer ... bnail.html

Hope it helps.
hello! I read this post with interest because I didn't realise that a thumbnail could be generated at the same size as the original i.e. cropped as you describe.

I have tried this out as follows:

Code: Select all
<cms:editable name="artist_photo" label="Upload your main Artist bio image here, click SAVE and the thumbnail will be generated automatically" desc='maximum width of 500px will be applied on upload.' width='500' enforce_max='1' show_preview='1' preview_height='200' type="image" order='40' />
<cms:editable name="artist_thumb" assoc_field="artist_photo" label="Thumbnail for display on grid of Artists on the Programme page" show_preview='1' width='228' height='228' enforce_max='0' type="thumbnail"  order='44'/>

and my square thumbnail is being generated but is resized. I tried explicity setting enforce_max to 0 but it didn't make any difference.

Any thoughts?
Hi potato,

I didn't realise that a thumbnail could be generated at the same size as the original
Umm.. not sure if we are on the same page. There are two mutually exclusive settings that work with both 'image' type and 'thumbnail' type - these are 'enforce_max' and 'crop'.

'enforce_max', as the name suggests, enforces that the image/thumbnail remains within the limits set by the 'height' and 'width' parameters. This result is an image(or thumbnail) that is always the same ratio/proportion of the original one (but usually smaller).

'crop' on the other hand always results in the image/thumbnail being *exactly* the same size as set by the 'height' and 'width'. Very often this necessitates cropping off portions from the original image (hence the name).

Please compare what I tried to explain above with what @pinky complained -
they are basically smaller version of big image and it is not correct as thumbnails should be only selection of the image, not showing full image!

Clearly 'smaller version of big image' is 'enforce_max' in action as it retains the ratio/proportion of the original. The 'thumbnails should be only selection of the image, not showing full image' would require 'crop' (which is the default with 'thumbnail' type).

Please see http://www.couchcms.com/docs/tags-refer ... image.html where there are plenty of images to illustrate the difference between the two.

Hope this helps.
oh, I thought it meant you could take a 200 x 200 piece out of say a 500 x 600 image without scaling it down. Barking up the wrong tree (again)!
KK wrote: Hello Pinky,

From the definitions of the editable regions you posted, there is only one thumbnail that should get created - the one named 'gg_thumb' (the one named 'gg_image' is the actual main image and not a thumbnail).

This 'gg_thumb' is used by Couch to show in the admin-panel gallery listing so you should not change its definition (as shown in the docs at http://www.couchcms.com/docs/concepts/p ... llery.html) i.e. leave it to 115x115.

To create your own version of thumbnail, please add one more editable region like this -
Code: Select all
<cms:editable
    name="my_thumb"
    assoc_field="gg_image"
    label="Image Thumbnail"
    desc="Second thumbnail of image above"
    width='200'
    height='200'
    type="thumbnail"
/>

In the definition above, we have *not* set 'enforce_max', and so the thumbnail will get cropped instead of getting resized, which is what you want.

Now you'd be able to use the 'Recreate cropping from' option to adjust which part of the image is used for the thumbnail.

Please see the docs on 'thumbnail' for how it works - http://www.couchcms.com/docs/tags-refer ... bnail.html

Hope it helps.


Hello KK,

THANK YOU VERY MUCH FOR YOUR HELP! It is working perfectly fine now and you just made my day! I've been trying to figure it out for weeks without any result, big thank you!
You are welcome, Pinky :) I'm glad I could help.
7 posts Page 1 of 1