@@ -693,16 +693,16 @@ export class ImageCropPickerTurboModule extends TurboModule implements TM.ImageC
693
693
} )
694
694
}
695
695
696
- async getFileInfo ( includeBase64 : boolean , filePath : string , tempFilePath : string , exifInfo : Exif ) : Promise < VideoImageInfo > {
696
+ async getFileInfo ( includeBase64 : boolean , filePath : string , compressOrTempFilePath : string , exifInfo : Exif ) : Promise < VideoImageInfo > {
697
697
let videoImageInfo : VideoImageInfo = { duration : null } ;
698
698
let imageType ;
699
- let i = this . isNullOrUndefined ( tempFilePath ) ? filePath . lastIndexOf ( '/' ) : tempFilePath . lastIndexOf ( '/' )
700
- let fileName = this . isNullOrUndefined ( tempFilePath ) ? filePath . substring ( i + 1 ) : tempFilePath . substring ( i + 1 )
699
+ let i = this . isNullOrUndefined ( compressOrTempFilePath ) ? filePath . lastIndexOf ( '/' ) : compressOrTempFilePath . lastIndexOf ( '/' )
700
+ let fileName = this . isNullOrUndefined ( compressOrTempFilePath ) ? filePath . substring ( i + 1 ) : compressOrTempFilePath . substring ( i + 1 )
701
701
i = filePath . lastIndexOf ( '.' )
702
702
if ( i != - 1 ) {
703
703
imageType = filePath . substring ( i + 1 )
704
704
}
705
- videoImageInfo . path = this . isNullOrUndefined ( tempFilePath ) ? filePrefix + filePath : tempFilePath + filePath ;
705
+ videoImageInfo . path = this . isNullOrUndefined ( compressOrTempFilePath ) ? filePrefix + filePath : compressOrTempFilePath + filePath ;
706
706
videoImageInfo . filename = fileName ;
707
707
videoImageInfo . mime = 'image/' + imageType ;
708
708
@@ -716,7 +716,7 @@ export class ImageCropPickerTurboModule extends TurboModule implements TM.ImageC
716
716
let imageIS = image . createImageSource ( file . fd )
717
717
let imagePM = await imageIS . createPixelMap ( )
718
718
let imgInfo = await imagePM . getImageInfo ( ) ;
719
- videoImageInfo . data = includeBase64 ? this . imageToBase64 ( filePath ) : null ;
719
+ videoImageInfo . data = includeBase64 ? this . imageToBase64 ( compressOrTempFilePath || filePath ) : null ;
720
720
videoImageInfo . height = imgInfo . size . height ;
721
721
videoImageInfo . width = imgInfo . size . width ;
722
722
videoImageInfo . exif = exifInfo ;
0 commit comments