Forum for discussing general topics related to Couch.
7 posts Page 1 of 1
Hi,

I upload image 400X600px or 1223X600px size and i want to scale in perticuler size like 100x50px.
how can i do.
Image
where innovation meets technology
Hi,

The documentation on 'image' editable region (http://www.couchcms.com/docs/tags-refer ... image.html) discusses quite heavily all the scaling/cropping options.

Is there something that you could not find in the docs?
Please let us know.

Thanks.
I suppose this is for the display of the image at the back end.

If so, this wont be working for me. I want to display the image on the front end of the site.

Say I have uploaded 3 images with dimensions:
Image 1 - 250px * 400px
Image 2 - 400px * 300px
Image 3 - 500px * 100px
This happens at the backend.

Now at the front end i want all these images to be shown in say 150px * 100px only.

How can i do this?
I suppose this is for the display of the image at the back end.
No. It is actually meant for the front-end.

Define your 'image' editable region with the following parameters
width='150'
height='100'
crop='1'
and that should resize the uploaded images to 150x100px.

One problem of using 'crop' with 'image' region is that you lose control over where the crop occurs (center by default).
If you require finer control, one way would be to NOT set height or width of original image and then create an associated 'thumbnail' region with the parameters mentioned above.

Thumbnail allows re-cropping from different coordinates in admin-panel so the problem mentioned would not apply.
On the front-end, instead of the main image, show the thumbnails.

Hope this helps.
@KK sir

Is it not possible that in place of cropping the entire image could be re-sized to 150px * 100px?
Image
where innovation meets technology
The image actually does get resized.
Cropping only comes in when the proportions of the original image do not match those of the resized image - in which case the superfluous portions are cropped off.

I suggest you please try out first-hand the code I recommended in the previous post and try uploading images of different sizes. See the results for yourself and let us know.
Ok sir!!!
Will give it a try once again!!!
Image
where innovation meets technology
7 posts Page 1 of 1