File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
android/src/main/java/com/reactnativemultipleimagepicker Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1+ # Fixed IsExportThumnail Missing And empty Thumbnail In Android Platform.
12# React Native Multiple Image Picker (RNMIP)
23
34<p align =" center " >
Original file line number Diff line number Diff line change @@ -20,10 +20,7 @@ import com.luck.picture.lib.manager.UCropManager
2020import com.luck.picture.lib.style.PictureParameterStyle
2121import com.yalantis.ucrop.model.AspectRatio
2222import com.yalantis.ucrop.view.CropImageView
23- import java.io.File
24- import java.io.FileOutputStream
25- import java.io.IOException
26- import java.io.OutputStream
23+ import java.io.*
2724import java.util.*
2825
2926
@@ -268,15 +265,18 @@ class MultipleImagePickerModule(reactContext: ReactApplicationContext) :
268265 try {
269266 var fOut: OutputStream ? = null
270267 val fileName = " thumb-" + UUID .randomUUID().toString() + " .jpeg"
271- print (" fileName $fileName " )
272268 val file = File (fullPath, fileName)
269+ file.parentFile.mkdirs()
273270 file.createNewFile()
274- fOut = FileOutputStream (file)
271+ try {
272+ val fos = FileOutputStream (file)
273+ image?.compress(Bitmap .CompressFormat .JPEG , 80 , fos)
274+ fos.flush()
275+ fos.close()
275276
276- // 100 means no compression, the lower you go, the stronger the compression
277- image?.compress(Bitmap .CompressFormat .JPEG , 50 , fOut)
278- fOut.flush()
279- fOut.close()
277+ } catch (e: FileNotFoundException ) {
278+ e.printStackTrace()
279+ }
280280
281281 return " file://$fullPath /$fileName "
282282 } catch (e: Exception ) {
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ export type PickerErrorCode =
3838export type Options < T extends MediaType = MediaType . ALL > = {
3939 mediaType ?: T ;
4040 isPreview ?: boolean ;
41+ isExportThumbnail ?:boolean ;
4142 selectedColor ?: string ;
4243 tapHereToChange ?: string ;
4344 cancelTitle ?: string ;
You can’t perform that action at this time.
0 commit comments