Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class IonCameraFlow(
editInApp = call.getBoolean("editInApp") ?: true,
quality = call.getInt("quality") ?: DEFAULT_QUALITY,
width = call.getInt("targetWidth") ?: 0,
height = call.getInt("targetWidth") ?: 0,
height = call.getInt("targetHeight") ?: 0,
correctOrientation = call.getBoolean("correctOrientation") ?: DEFAULT_CORRECT_ORIENTATION
)
}
Expand All @@ -218,15 +218,19 @@ class IonCameraFlow(

fun getCameraSettings(call: PluginCall): IonCameraSettings {
val settings = IonCameraSettings()
settings.quality = call.getInt("quality", IonCameraSettings.DEFAULT_QUALITY)!!
settings.targetWidth = call.getInt("targetWidth", 0)!!
settings.targetHeight = call.getInt("targetHeight", 0)!!
settings.correctOrientation = call.getBoolean("correctOrientation", IonCameraSettings.DEFAULT_CORRECT_ORIENTATION)!!
settings.encodingType = call.getInt("encodingType", IonCameraSettings.DEFAULT_ENCODING_TYPE)!!
settings.saveToGallery = call.getBoolean("saveToGallery", IonCameraSettings.DEFAULT_SAVE_IMAGE_TO_GALLERY)!!
settings.allowEdit = call.getBoolean("allowEdit", false)!!
settings.editInApp = call.getBoolean("editInApp", true)!!
settings.includeMetadata = call.getBoolean("includeMetadata", false)!!
settings.quality = call.getInt("quality") ?: IonCameraSettings.DEFAULT_QUALITY

val width = call.getInt("targetWidth") ?: 0
val height = call.getInt("targetHeight") ?: 0

settings.targetWidth = if (width < 1) -1 else width
settings.targetHeight = if (height < 1) -1 else height
settings.correctOrientation = call.getBoolean("correctOrientation") ?: IonCameraSettings.DEFAULT_CORRECT_ORIENTATION
settings.encodingType = call.getInt("encodingType") ?: IonCameraSettings.DEFAULT_ENCODING_TYPE
settings.saveToGallery = call.getBoolean("saveToGallery") ?: IonCameraSettings.DEFAULT_SAVE_IMAGE_TO_GALLERY
settings.allowEdit = call.getBoolean("allowEdit") ?: false
settings.editInApp = call.getBoolean("editInApp") ?: true
settings.includeMetadata = call.getBoolean("includeMetadata") ?: false
settings.shouldResize = settings.targetWidth > 0 || settings.targetHeight > 0
return settings
}
Expand Down
Loading