@@ -224,12 +224,6 @@ export class ImageCropPickerTurboModule extends TurboModule implements TM.ImageC
224
224
225
225
async openPicker ( options ?: Options ) : Promise < Video [ ] | Video | ImageOrVideo [ ] | ImageOrVideo | Image [ ] | Image > {
226
226
Logger . info ( `${ TAG } into openPicker request ${ JSON . stringify ( options ) } ` ) ;
227
- let permissionResult = await this . grantPermission ( ) ;
228
- if ( ! permissionResult ) {
229
- return new Promise ( async ( res , rej ) => {
230
- rej ( 'permission not approved' )
231
- } )
232
- }
233
227
let minFiles = this . isNullOrUndefined ( options ?. minFiles ) ? MinNumber : options . minFiles ;
234
228
let maxFiles = this . isNullOrUndefined ( options ?. maxFiles ) ? MaxNumber : options . maxFiles ;
235
229
let isShowSerialNum = this . isNullOrUndefined ( options ?. showsSelectedCount ) ? true : options ?. showsSelectedCount ;
@@ -391,12 +385,6 @@ export class ImageCropPickerTurboModule extends TurboModule implements TM.ImageC
391
385
async openCamera ( options ?: Options ) : Promise < Video [ ] | Video | ImageOrVideo [ ] | ImageOrVideo | Image [ ] | Image > {
392
386
Logger . info ( `${ TAG } into openCamera request = ${ JSON . stringify ( options ) } ` ) ;
393
387
let cropping = this . isNullOrUndefined ( options ?. cropping ) ? false : options ?. cropping ;
394
- let permissionResult = await this . grantPermission ( ) ;
395
- if ( ! permissionResult ) {
396
- return new Promise ( async ( res , rej ) => {
397
- rej ( 'permission not approved' )
398
- } )
399
- }
400
388
let quality = options . compressImageQuality ;
401
389
if ( ! this . isNullOrUndefined ( quality ) && ! ( quality >= 0 && quality <= 1 ) ) {
402
390
return new Promise ( async ( res , rej ) => {
@@ -424,7 +412,7 @@ export class ImageCropPickerTurboModule extends TurboModule implements TM.ImageC
424
412
let imgOrVideoPath = pickerResult . resultUri ;
425
413
isImg = this . isImage ( imgOrVideoPath ) ;
426
414
if ( isImg ) {
427
- let file = fs . openSync ( imgOrVideoPath , fs . OpenMode . CREATE ) ;
415
+ let file = fs . openSync ( imgOrVideoPath , fs . OpenMode . READ_ONLY ) ;
428
416
try {
429
417
let dstPath = this . ctx . uiAbilityContext . tempDir + '/rn_image_crop_picker_lib_temp_' + util . generateRandomUUID ( true ) + '.jpeg' ;
430
418
fs . copyFileSync ( file . fd , dstPath , 0 ) ;
@@ -648,12 +636,6 @@ export class ImageCropPickerTurboModule extends TurboModule implements TM.ImageC
648
636
rej ( 'path is empty' )
649
637
} )
650
638
}
651
- let permissionResult = await this . grantPermission ( ) ;
652
- if ( ! permissionResult ) {
653
- return new Promise ( async ( res , rej ) => {
654
- rej ( 'permission not approved' )
655
- } )
656
- }
657
639
let quality = options . compressImageQuality ;
658
640
if ( ! this . isNullOrUndefined ( quality ) && ! ( quality >= 0 && quality <= 1 ) ) {
659
641
return new Promise ( async ( res , rej ) => {
0 commit comments