question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resizing doesn't work at all

See original GitHub issue

Hello, I like this cropper very much. However, the resizing feature doesn’t seem to work at all. I am using the Activity approach, like this: CropImage.activity(sourceFile) .setActivityTitle(this.getResources().getString(R.string.CropImage)) .setAspectRatio(1, 1) .setAutoZoomEnabled(true) .setFixAspectRatio(true) .setGuidelines(CropImageView.Guidelines.OFF) .setNoOutputImage(false) .setOutputCompressQuality(70) .setOutputUri(sourceFile) .setRequestedSize(512, 512) .start(this); The image comes from the camera and should be then cropped by user. The resulting image, no matter what, should be 512x512px, whether the user selected larger or smaller region from the image, than those dimensions. However, I am still getting only the cropped region in its original size, instead of 512x512. In the code above, “sourceFile” is an Uri pointing to local filesystem, and at that Uri, picture taken from camera already exists. I would like to crop and resize it in-place if possible (replacing the original large image). By debugging the code of this library, I found out that in class CropImageView, method startCropWorkerTask, resizing is only performed if mLoadedSampleSize > 1. But for my case, mLoadedSampleSize is always 1. I don’t understand the meaning of this variable and even when I commented the condition out, I still got image of size 847x847, not 512x512. Please can you advice what should I do, or is this a bug?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Mek7commented, Nov 30, 2016

@princekhan2 your problem is not related to this issue. This one has been already solved and closed, please file a new issue for your problem.

0reactions
princekhan2commented, Nov 30, 2016

Hi sir i am new to programming . Your croper image so nice and good . But in my case it does not work compile ‘com.theartofdev.edmodo:android-image-cropper:2.3.+’ And I added the activity in the manifest .

<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity" android:theme="@style/Base.Theme.AppCompat"/> Java code

photo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {

//Intent imageDownload = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

Intent imageDownload=new Intent(); imageDownload.setAction(Intent.ACTION_GET_CONTENT); imageDownload.setType(“image/*”); startActivityForResult(imageDownload, GALLERY_REQUEST_CODE); }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==GALLERY_REQUEST_CODE && requestCode==RESULT_OK) { Uri imageUri=data.getData(); CropImage.activity(imageUri) .setGuidelines(CropImageView.Guidelines.ON) .start(this); } if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) { CropImage.ActivityResult result = CropImage.getActivityResult(data); if (resultCode == RESULT_OK) { Uri resultUri = result.getUri(); m.setImageURI(resultUri); } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) { Exception error = result.getError(); } } I am using android studio 2.2.1. And android version lollipop 21.

Read more comments on GitHub >

github_iconTop Results From Across the Web

8 Fixes When You Can't Resize Window in Windows 11 and 10
1. Try Keyboard Shortcuts to Resize a Window · 2. Turn Off Tablet Mode · 3. Uninstall TeamViewer · 4. Close All Apps...
Read more >
Windows 11:Can't move or resize windows/applications
I updated windows not too long ago and now my application windows don't want to move or resize. It's pretty annoying. All I...
Read more >
Resizing of windows is not reliable - Visual Studio Feedback
When I move VS to the 100% (secondary) monitor, resizing constantly fails. It works if the size change is large (roughly, >0.5 the...
Read more >
doesn't work unless resizing the window · Issue #53 - GitHub
It seems that the problem occurs if the bricks don't have a rounded height. So we don't need to set the height of...
Read more >
Resizing Plugin Window doesn't work at all - Steinberg Forums
This doesn't mean, you can freeze resize any plug-in window to any size you want to. This means that if some plug-in offers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found