callstack / react-native-image-editor

A library providing an API for cropping images from the web and the local file system.
MIT License
383 stars 118 forks source link

feature: [web/android/ios] Upon success, return more image information #140

Closed retyui closed 9 months ago

retyui commented 9 months ago

Summary

Part of 4.x release: Convert a uri crop result to an object

Test plan

Examples:

// web
{
    "width": 1125,
    "height": 750,
    "name": "ReactNative_cropped_image.jpeg",
    "size": 283213,
    "path": "blob:http://localhost:8082/43ff7a16-c464-4130-a3d2-95286bae46b1",
    "uri": "data:image/jpeg;base64,/9j/4A|"
}
// android
{
  "height": 600,
  "size": 31520,
  "name": "ReactNative_cropped_image_5129169684629022727.jpg",
  "width": 800,
  "uri": "file:///data/user/0/com.rn73/cache/ReactNative_cropped_image_5129169684629022727.jpg",
  "path": "/data/user/0/com.rn73/cache/ReactNative_cropped_image_5129169684629022727.jpg"
}
// ios
{
  "path": "/Users/davydnarbutovich/Library/Developer/CoreSimulator/Devices/0CA37DFB-8AF0-4714-A849-82E2EE03634F/data/Containers/Data/Application/AD103DB7-10DA-4D4E-A7DD-BDCE371A961D/Library/Caches/ReactNative_cropped_image_/431C35F1-29EC-4972-84C5-01574DDCFDEE.png",
  "size": 280504,
  "height": 800,
  "name": "431C35F1-29EC-4972-84C5-01574DDCFDEE.png",
  "uri": "file:///Users/davydnarbutovich/Library/Developer/CoreSimulator/Devices/0CA37DFB-8AF0-4714-A849-82E2EE03634F/data/Containers/Data/Application/AD103DB7-10DA-4D4E-A7DD-BDCE371A961D/Library/Caches/ReactNative_cropped_image_/431C35F1-29EC-4972-84C5-01574DDCFDEE.png",
  "width": 600
}