How to store cropped version of the image?

When you crop an image, the widget uploads an original image and you receive a CDN URL with crop operation applied. If you want to save cropped image instead, you will need to turn off the “auto store” option in your project settings. In this case, all uploaded files will be removed in 24 hours. When you receive a CDN URL with crop operation you need to send a REST API request (POST /files/) to store this file and set received CDN URL as a source:

curl -X POST \\
-H "Authorization: Uploadcare.Simple demopublickey:demoprivatekey" \\ 
-d "source=,11/-/preview/" \\ 
-d "store=true" \\     

Note that you’ll need to provide your API keys instead of demo keys. In the response, you’ll get a new CDN URL.

A cropped image is saved, the original image will be removed after 24 hours.


I can’t seem to make this work with the uploader widget

        <input ref="uploader" type="hidden"
               data-image-shrink="300x300" :store="true" :data-rotate="true"
               data-crop="1:1" :data-images-only="true"

How am I supposed to make only save cropped version? I have no need for the un-cropped version.


I figured it out, but if it could be possible in the future to automatically only save the cropped image I would be very grateful! Have a great day! :slight_smile: