-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from Dhaval2404/feature/v1.8
v1.8 Released
- Loading branch information
Showing
28 changed files
with
397 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
imagepicker/src/main/kotlin/com/github/dhaval2404/imagepicker/listener/DismissListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.github.dhaval2404.imagepicker.listener | ||
|
||
/** | ||
* Interface used to allow the creator of a dialog to run some code when the | ||
* dialog is dismissed. | ||
* | ||
* @author Dhaval Patel | ||
* @version 1.8 | ||
* @since 19 December 2020 | ||
*/ | ||
interface DismissListener { | ||
|
||
/** | ||
* This method will be invoked when the dialog is dismissed. | ||
*/ | ||
fun onDismiss() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
imagepicker/src/main/kotlin/com/github/dhaval2404/imagepicker/util/ExifDataCopier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.github.dhaval2404.imagepicker.util | ||
|
||
import android.util.Log | ||
import androidx.exifinterface.media.ExifInterface | ||
import java.io.File | ||
|
||
/** | ||
* This file was taken from | ||
* https://raw.githubusercontent.com/flutter/plugins/05879a3a4d8e582702227731ccdcf8b115f6b83d/packages/image_picker/image_picker/android/src/main/java/io/flutter/plugins/imagepicker/ExifDataCopier.java | ||
*/ | ||
object ExifDataCopier { | ||
|
||
fun copyExif(filePathOri: File, filePathDest: File) { | ||
try { | ||
val oldExif = ExifInterface(filePathOri) | ||
val newExif = ExifInterface(filePathDest) | ||
val attributes: List<String> = listOf( | ||
"FNumber", | ||
"ExposureTime", | ||
"ISOSpeedRatings", | ||
"GPSAltitude", | ||
"GPSAltitudeRef", | ||
"FocalLength", | ||
"GPSDateStamp", | ||
"WhiteBalance", | ||
"GPSProcessingMethod", | ||
"GPSTimeStamp", | ||
"DateTime", | ||
"Flash", | ||
"GPSLatitude", | ||
"GPSLatitudeRef", | ||
"GPSLongitude", | ||
"GPSLongitudeRef", | ||
"Make", | ||
"Model", | ||
"Orientation" | ||
) | ||
for (attribute in attributes) { | ||
setIfNotNull(oldExif, newExif, attribute) | ||
} | ||
newExif.saveAttributes() | ||
} catch (ex: Exception) { | ||
Log.e("ExifDataCopier", "Error preserving Exif data on selected image: $ex") | ||
} | ||
} | ||
|
||
private fun setIfNotNull(oldExif: ExifInterface, newExif: ExifInterface, property: String) { | ||
if (oldExif.getAttribute(property) != null) { | ||
newExif.setAttribute(property, oldExif.getAttribute(property)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,5 +98,4 @@ object FileUtil { | |
else -> Bitmap.CompressFormat.JPEG | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.