blocks icon indicating copy to clipboard operation
blocks copied to clipboard

Crop by aspect ratio in image editor

Open rawstream opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. I would like to use the Built-in image editor by passing a cdnUrl that contains a crop operation by aspect ratio. The operation is ignored and the editor does show the uncropped image instead.

image

Describe the solution you'd like The Built-in image editor supports 'Crop by aspect ratio'.

rawstream avatar May 29 '24 11:05 rawstream

This would be great if this is resolved.

p4m avatar May 30 '24 11:05 p4m

Hello! Thanks for feedback.

I have two questions:

  • Should the editor enforce a fixed crop aspect ratio and prevent changes to the aspect ratio during editing?
  • Do you specifically need the resulting URL to contain /crop/16:9/ operation? Would it be acceptable if the crop operation is absolutely positioned in the output URL? For instance, if you provide a URL with /crop/1:1/ and receive a result with /crop/1000x1000/100,0/?

nd0ut avatar May 30 '24 14:05 nd0ut

  1. With the 'freeform' feature coming in the near future (mentioned by Alex via a personal email message on May 16th), I would expect that the user can change the aspect ratio. When offered different aspect ratios to the user. See below the feature in the Uploadcare docs. image
  2. I personally would expect that the crop operation is done like it is now, in the previous widget: cropped in the center of the image, based on the aspect ratio.

p4m avatar May 30 '24 15:05 p4m

Hi @nd0ut , Thanks for your response.

Should the editor enforce a fixed crop aspect ratio and prevent changes to the aspect ratio during editing?

I don't think this should be the default behaviour.

Do you specifically need the resulting URL to contain /crop/16:9/ operation? Would it be acceptable if the crop operation is absolutely positioned in the output URL? For instance, if you provide a URL with /crop/1:1/ and receive a result with /crop/1000x1000/100,0/?

It would definitely be acceptable if the crop operation is absolutely formatted in the output URL. The main issue is that the editor currently does not recognize /crop/16:9. The format of the output URL after editing doesn't really matter.

rawstream avatar May 30 '24 17:05 rawstream