Forum for discussing general topics related to Couch.
8 posts Page 1 of 1
For my photo gallery, I am using KC Finder to upload the image. I have a problem, how to make the the image auto resize to a small file?

My client use all high resolution images which mostly >7mb, the size approximate 4000 x 2500px. I like to resize the image to max width 1000px, is this possible?

I tried to changed the config file:
Code: Select all
'maxImageWidth' => 1000,
    'maxImageHeight' => 1000,


Nothing changed. If my client keep upload the big image files, the memory will hit the limit pretty soon, and I believe user have to wait forever to load those images. Any suggestion?

Something like this: https://blueimp.github.io/jQuery-File-Upload/
Never mind, just found the answer...

by adding this code into plupload/upload.php:
Code: Select all
resize: { width: 1000, height: 700, quality: 80 },
That was my question exactly. But where in "plupload/upload.php" did you insert that bit of code? :?:

Code: Select all
resize: { width: 1000, height: 700, quality: 80 },


I'm a little unfamiliar with the script's language.

Thank you!
I was under the impression that max image sizing was done in the <cms:editable tag like this:

Code: Select all
<cms:editable
      name="gg_image"
      label="Image"
      desc="Upload your main image here"
      width="1000"
      type="image"
   />
@wysocki, you are correct. Setting the dimensions directly into cms:editable is the right way to resize images.
I know this is a very old thread, but i have a question that best fits what's already been said here.
Setting the dimensions directly into cms:editable is the right way to resize images.

...i understand that it's definitely the way to go when using regions of type image and such. But is there a way to set a global maximum for the dimensions of uploaded images? To be precise: I want to set the uploaded images dimensions for image regions just as you said, but also have a global fallback limit that triggers resizing images generally when uploaded anywhere. For example: If the user wants to insert in image in a richtext region (i know - i shouldn't give the user too much power, but sometimes you just have to let them to stuff), uploads a huge image and inserts it into the richtext, it will be there in full size.
I am not talking about resizing the image visually (i can easily do that via CSS, like
Code: Select all
img {max-width: 100%;}
or something like this), but really trigger a resizing for the actual uploaded image file. It that possible? I think it would be very useful!

Thanks for your help!
@mumpitz, I am sorry but, as of now, we don't have this feature.
It is a useful suggestion though and I'll definitely keep this in mind for the future.

Thanks.
Regarding automatic resizing of uploaded images, I want to point out, for those who run into this old thread and need to control automatic image resizing for images uploaded through kcfinder, you can do that by editing the file /<couch admin dir>/includes/kcfinder/config.php. The lines to change are:
Code: Select all
..
'maxImageWidth' => 550,
'maxImageHeight' => 0,
...


The above configuration lines will cause uploaded images of over 550 pixels width to be resized to 550 px. Height will be modified to maintain the aspect ratio. (A zero setting means there is no limit on the specified image dimension.)

For more information, consult the kcfinder docs here:
https://kcfinder.sunhater.com/install
8 posts Page 1 of 1