I'm currently looking to try and create a simple image uploader application which allows a user to load a picture from their desktop, select a crop area (using jcrop) in a specific aspect ratio, and then have filepicker.io crop to the defined dimensions and resize down appropriately.
The users will be uploading a picture of unknown dimensions, selecting an area that is in 10:13 ratio (width x height) and then filepicker needs to crop their image before resizing it to 100x130px.
Currently I have to perform 2 separate convert actions to crop and resize the image, which takes additional time and seems less efficient than it could be. Is there any way to combine crop and resize into a single action?
To get an idea of what I'm after, I would like this command to return an image 100x130 cropped to my ideal size:
/convert?crop=546,119,412,36&w=100&h=130
You can see a note on their documentation about the topic:
Crop and Resize: we strongly recommend against combining a resize (specifying width or height) with the crop functionality, as it has indeterminant effects depending on whether the crop is applied before or after the image is resized.
Source: https://developers.inkfilepicker.com/docs/web/#inkblob-images
It is possible and easy to do with Uploadcare
Here is an example:
Original image:
https://ucarecdn.com/c35d77e8-4b09-4040-ad36-a5b264f17094/CDN.png
Cropped and resized image, in one operation:
https://ucarecdn.com/c35d77e8-4b09-4040-ad36-a5b264f17094/-/crop/570x460/730,70/-/resize/200x150/Resized_CDN.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With