Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeping only the needed Image edit options after cropping the image. #60

Closed
shreyask12 opened this issue Sep 6, 2019 · 7 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@shreyask12
Copy link

Is there any way we can give only few image edit options after cropping the image to the user.
For example :

  1. User clicks the image.
  2. Then crop the image options appear (edge detection)
  3. Next screen there are edit options such as Rotate left,rotate right,B&W,MAGIC,etc

is there any way we can provide only few edit options out of all this for ex we provide only Magic and rotate options.

I tried to look for any parameters to pass with the options object in the scanDoc()

scan.scanDoc(successCallback, errorCallback,opts);
but i cant find any. Please help.
eidtOptions

@ChrisTomAlx ChrisTomAlx added the enhancement New feature or request label Sep 6, 2019
@ChrisTomAlx ChrisTomAlx self-assigned this Sep 6, 2019
@ChrisTomAlx
Copy link
Collaborator

Hey @shreyask12
Currently this isn't possible with the plugin.
But it is an interesting feature and I'll add it to our enhancement backlog.

For your immediate use, you could fork the scanlibrary repo in this github account and remove those buttons in the android code manually. If you would like to contribute to this plugin, I will gladly guide / work with you in making the appropriate changes.

Cheers,
Chris
Neutrinos

@shreyask12
Copy link
Author

Thanks for your reply i would like to contribute to the plugin but for immediate use could you please guide me how to remove those buttons from the android code manually through the scanlibrary.

@ChrisTomAlx
Copy link
Collaborator

ChrisTomAlx commented Sep 6, 2019

Hey @shreyask12
If you understand android native code it is pretty straight forward. You can fork the library then just disable the buttons in the xml layout using the android:visibility = "gone" xml property. Then change the build.gradle file in this plugin to point to your fork of the scanlibrary.

Please consider raising a new issue if you are thinking about contributing.

Cheers,
Chris
Neutrinos

@shreyask12
Copy link
Author

hey Chris, I did as you pointed out in the xml library and disabled the buttons but i am not able to point out to the forked @scanlibrary to the build.gradle. I am still getting the buttons visible even after changing the build.gradle to my forked scanlibrary.

this is my build.gradle after changing

allprojects {
repositories {
maven {
url 'https://jitpack.io'
}
}
}

dependencies {
implementation 'com.github.shreyask12:scanlibrary:2.3'
}

earlier it was

dependencies {
implementation 'com.github.NeutrinosPlatform:scanlibrary:2.3'
}

@ChrisTomAlx
Copy link
Collaborator

The 2.3 here represents the release version. You have to create a release on github to get that version's build, if not you have to use master-snapshot. Refer to this to get the latest snapshot builds.

Also your current build is failing.

I am assuming you are changing the build.gradle from android studio. Instead you can just change it within your fork of the plugin. Then install that plugin using cordova plugin add https://github.com/shreyask12/cordova-plugin-document-scanner

Cheers,
Chris
Neutrinos

@shreyask12
Copy link
Author

Thanks @ChrisTomAlx for your help, i achieved what i was looking for with your instructions. But there is still one issue i.e the size of the app increases drastically from 10mb to 45 mb on installing the plugin.
i tried the solution provided by you in earlier issue from #45
it reduces the apk size from 45 to 35 mb but my original apk size before installing the plugin was 10mb.

@ChrisTomAlx
Copy link
Collaborator

Yea that is expected behavior since we are adding the opencv library to perform image manipulations. opencv is a huge library and this can't be helped. The only advice I can give is to remove some of the other architectures (maybe the 32 bit architectures, although this might cause the app not to work in older phones).

Closing this issue now.

Cheers,
Chris
Neutrinos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants