Project

General

Profile

Actions

Feature proposal #4378

closed

Implement client side cropping

Added by krileon over 10 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
19 December 2013
Due date:
% Done:

100%

Estimated time:
10:00 h

Description

This would enable a user generated thumbnail instead of generating it automatically by re-sizing. If disabled behave as it normally would (re-size fullsize). After upload the default crop should be maximum thumbnail sizes from the center of the image. If they visit profile edit they'll see the fullsize which they can adjust the cropping for as needed. Again, if disabled just show normal behavior.

In addition to this implement minimum height/width parameters for images. If the image is below the minimum then reject it with a validation error or upscale depending on new validation parameter value. If no minimum is specified then don't bother checking it.

If thumbnail sizes exceed fullsize sizes then set them to fullsize sizes to avoid any issues.

The minimum and maximum thumbnail width and height should be used for the selector.

Implement 2 new parameters to determine what location displays what version of the image. Example as follows.

Profile Image: Fullsize
Userlist Image: Thumbnail

This would let you select the size displayed at either of the two locations.

Actions #1

Updated by beat about 10 years ago

  • Estimated time set to 10:00 h

Done with jquery ajax file upload

Actions #2

Updated by krileon almost 10 years ago

Extending "Maintain Aspect Ratio" with a "Yes, Crop" so the image always re-sizes to the specified max width/height except it crops off the excess.

Actions #3

Updated by beat almost 10 years ago

  • Target version changed from CB 2.0.0 to CB 2.1
Actions #4

Updated by krileon about 9 years ago

Review replacing jCrop (currently unused) with Cropper (http://fengyuanchen.github.io/cropper/) as a better alternative that's more feature complete.

Actions #5

Updated by krileon about 8 years ago

Also review http://www.dropzonejs.com/.

Ideally should create a "cbupload" jQuery plugin to handle the AJAX uploading with support for cropping, preview, drag and drop, etc.. it needs to bridge these other usages to avoid permanent dependency (like my other jquery plugins).

Actions #6

Updated by krileon over 7 years ago

Doesn't need to be ajax uploaded. Use the same methods as the new resize validation rule to convert it to data. It should then display the thumbnail selector to select the coordinates to crop the image to.

This should be a new setting for "Maintain Aspect Ratio". It can probably be "Yes, with User Cropping". It'll work the same as "Yes, with Cropping" except it'll let the user select the cropping instead of just centering it and chopping off the rest. This means this should simply extend the existing resize validation rule.

Actions #7

Updated by krileon over 7 years ago

  • Subject changed from Implement jCrop for image fields to Implement client side cropping
  • Description updated (diff)
Actions #8

Updated by krileon over 7 years ago

Instead of adding additional minimum parameters the thumbnail size should simply just act as a minimum. It wouldn't make sense for the fullsize to be smaller than the thumbnail so it should upscale.

Edit: n/m we don't need or care about a minimum for this. Resize to the maximum allowed within the aspect ratio of the image then let the user select where the crop will take place. Depending on the image the crop will be vertical or horizontally dragged around.

Actions #9

Updated by krileon over 7 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Implemented in MR !!1125

New parameter value for image fields lets you select "Yes, with User Cropping" for "Maintain Aspect Ratio". Once the image is selected (and valid) if it exceeds the maximum width or height the user is asked to select where to crop it. The upscaling works exactly like "Yes, with Cropping". This means set maximum width and height to 200 for example and you'll always have squared images, but now the user can select the cropping instead of it forced to crop the center.

Actions #10

Updated by krileon over 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF