simformsolutionspvtltd / ssimagepicker Goto Github PK
View Code? Open in Web Editor NEWEasy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... ๐ธ
License: Apache License 2.0
Easy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... ๐ธ
License: Apache License 2.0
Can you modify it so i'm able to call it from a fragment ?
override fun onAttach(context: Context) {
super.onAttach(context)
mListener = if (context is ItemClickListener) {
context
} else {
throw RuntimeException("$context")
}
}
the if condition always fails and throws RuntimeException
imagePicker = ImagePickerActivityClass(requireContext(), requireActivity(), this, requireActivity().activityResultRegistry)
file:/storage/emulated/0/Android/data/com.abc.customer/files/Pictures/JPEG_20210503_232332_6233313561642340468.jpg: open failed: ENOENT (No such file or directory)
Not able to get file from returned String
Device Android 10
Describe the bug
I have implemented this library inside fragment. After exiting the fragment with back button and open the same fragment and try to open image picker error occur you can find the stacktrace below.
Additional context
FATAL EXCEPTION: main
Process: com.example.evetanhr.debug, PID: 15333
java.lang.IllegalArgumentException: SavedStateProvider with the given key is already registered
at androidx.savedstate.SavedStateRegistry.registerSavedStateProvider(SavedStateRegistry.kt:110)
at com.app.imagepickerlibrary.util.PickerConfigManager.init$lambda-0(PickerConfigManager.kt:25)
at com.app.imagepickerlibrary.util.PickerConfigManager.$r8$lambda$yxq-75EwC_9xo5MojhV7-4heekM(Unknown Source:0)
at com.app.imagepickerlibrary.util.PickerConfigManager$$ExternalSyntheticLambda0.onStateChanged(Unknown Source:4)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:202)
at com.app.imagepickerlibrary.util.PickerConfigManager.(PickerConfigManager.kt:22)
at com.app.imagepickerlibrary.ImagePicker.(ImagePicker.kt:27)
at com.app.imagepickerlibrary.ImagePicker.(Unknown Source:0)
at com.app.imagepickerlibrary.ImagePicker$Companion.registerImagePicker(ImagePicker.kt:232)
at com.example.evetanhr.view.add.AddEmployeePersonalDetailsFragment.onCreate(AddEmployeePersonalDetailsFragment.kt:66)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:3090)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:257)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7697)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Thanks for developing a useful library.
It would be really great if you add a new feature "free hand crop" where we can pick comers and adjust ratios.
Is your feature request related to a problem? Please describe.
Hi, thanks this awesome plugin and author's hard work! I wonder this awesome plugin if could support Activity,because now I want to using in Flutter. But in flutter, its using FlutterActivity which is only extends Activity.
I think the main problem is that I cannot register in Acitivity,the registerImagePicker is only support ComponentActivity or Fragment.
companion object {
fun ComponentActivity.registerImagePicker(callback: ImagePickerResultListener): ImagePicker {
return ImagePicker(callback, this)
}
fun Fragment.registerImagePicker(callback: ImagePickerResultListener): ImagePicker {
return ImagePicker(callback, requireActivity())
}
}
thank you~
If I already have an installed app with this library and I try to installed another app I am getting the following error
The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER
I think the authorities for the file provider in the manifest are the same so that why it is conflicting.
android:authorities="com.app.imagepickerlibrary.provider"
Thank for the great library. It would be cool to have an option to open camera or gallery directly.
I think multi select is mandatory futur for such great library. I love this library I think it only need that and it will be perfect. Thank you
hi thank you for this library
my English is not good , i try to explain
i want to set crop 16:9 and disable changing by user
and disable and hide rotating
one more thing1:
when i try to scale image with two finger , when my fingers are on the crop section , its not work (crop rectangle move , i want to scale image not move the crop rectangle ) . i think it is better that crop rectangle fixed in and image can move and scale.
one more thing2:
when an activity run two ImagePicker , the result function " fun onImagePick(uri: Uri?)" must have a "request code" to know where to use the uri
sorry for my english :)
Hello, i have a xiaomi phone and recently my phone api as been updated to android 11. So now when i open the bottomsheet dialog with any trigger , he do his work but i don't have any access to a file. I make some chearch and i see that when you target android 11+ asking read and write permission they not sufficient to have the permissions. I don't know if i'm wrong. Thank you for reply this.
java.io.FileNotFoundException: /external_files/Android/data/com.diamondvendor/files/Pictures/JPEG_COMPRESS_IMG_20231031_114338.jpg_7741807157170877795.jpg (No such file or directory)
Click picture through camera or when enable compression this issue is happening.
Even file is not present on file manager.
This issue is happening on Android 9.0
Describe the bug
Hello, thanks again for the library, work really well ;)
I have a couple of crash on production linked to Extension.getImageList()
when name == null
I couldn't reproduce it, just a couple of stacktrace from crqashlytics
Fatal Exception: java.lang.NullPointerException: name must not be null at com.app.imagepickerlibrary.ExtensionsKt$getImagesList$2.invokeSuspend(Extensions.kt:253) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
I didn't really dig into it, and I don't know how important the name is for a picture, but I was wondering if just avoiding picture if any params of the cursor is null could fix it without creating too many unwanted behavior
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.