1

Having a bit of a head scratcher with Uploadcare's Widget in PHP when it comes to cropping.

The widget is cropping, but uploading a full size image regardless. Grabbing the UUID and storing it in database for later retrieval.

What am I missing?

Thanks!

As per the PHP API I am passing the attributes in the array

getInputTag('uuid', array("data-images-only" => "true", "data-crop" => "150x150"))

Controller code

$uuid = $api->getFile($request->uuid)->data['original_file_url'];
Dmitry Mukhin
  • 6,649
  • 3
  • 29
  • 31
JonYork
  • 1,223
  • 8
  • 31
  • 52

1 Answers1

1

Uploadcare always uploads original files. When user crops an image in the widget, it returns a CDN URL with cropping operations applied.

You need to capture this URL (not just UUID) and save it in your app.

This may help:

$cropped_url = $api->getFile($request->uuid)->getUrl();

Also note, that uuid is a misleading input and var name in this case :)

Dmitry Mukhin
  • 6,649
  • 3
  • 29
  • 31