diff --git a/library/src/main/java/com/scanlibrary/PickImageFragment.java b/library/src/main/java/com/scanlibrary/PickImageFragment.java index 06e43df..1c72d4a 100644 --- a/library/src/main/java/com/scanlibrary/PickImageFragment.java +++ b/library/src/main/java/com/scanlibrary/PickImageFragment.java @@ -377,7 +377,12 @@ protected void postImagePick(Bitmap bitmap) { private Bitmap getBitmap(Uri selectedimg) throws IOException { BitmapFactory.Options options = new BitmapFactory.Options(); - options.inSampleSize = 1; + try { + int quality = getArguments().getInt("quality", 1); + options.inSampleSize = quality; + } catch (Exception e) { + options.inSampleSize = 1; + } AssetFileDescriptor fileDescriptor = null; fileDescriptor = getActivity().getContentResolver().openAssetFileDescriptor(selectedimg, "r"); diff --git a/library/src/main/java/com/scanlibrary/ScanActivity.java b/library/src/main/java/com/scanlibrary/ScanActivity.java index c918242..5b18d3d 100644 --- a/library/src/main/java/com/scanlibrary/ScanActivity.java +++ b/library/src/main/java/com/scanlibrary/ScanActivity.java @@ -7,6 +7,7 @@ import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; +import android.util.Log; /** * Created by jhansi on 28/03/15. @@ -24,6 +25,7 @@ private void init() { PickImageFragment fragment = new PickImageFragment(); Bundle bundle = new Bundle(); bundle.putInt(ScanConstants.OPEN_INTENT_PREFERENCE, getPreferenceContent()); + bundle.putInt("quality", getIntent().getIntExtra("quality", 1)); fragment.setArguments(bundle); android.app.FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); @@ -124,4 +126,4 @@ public void onTrimMemory(int level) { static { Loader.load(); } -} \ No newline at end of file +}