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.

Doesn't work if i choose second image after the first image has been cropped

See original GitHub issue

I am using the activity flow of cropping an image. I start the cropper activity by using

CropImage.activity(uri)
                            .setGuidelines(CropImageView.Guidelines.ON)
                            .setOutputUri(outputUri)
                            .start(this);

and gets the cropped image which i then passes on to another which renders it perfectly. but when i get back to the previous activity which is responsible for using the image, i again starts the cropper activity using the above code. The cropper activity launches but it shows a blank screen with a loader in the center which keeps on loading for like infinity. capture _2016-10-26-17-56-58

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
AvatarQingcommented, Dec 3, 2016

In my case, I didn’t use AsyncTask by myself, I used facebook ad sdk to show an ad in previous page of cropper, the loading of the ad was slow, and it blocked the cropper’s loading, so I guess it used AsyncTask too, I can’t control it.

I suggest you can call AsyncTask’s executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR) which can simply execute tasks in parallel.

1reaction
AvatarQingcommented, Dec 2, 2016

This is because BitmapLoadingWorkerTask is extend AsyncTask, and every instance of AsyncTask is using the same serial executor by default. When our app use AsyncTask first in other place, then open crop page, BitmapLoadingWorkerTask has to wait to execute until other instance of AsyncTask’s execution finished. I think the author should execute BitmapLoadingWorkerTask on a custom non-serial executor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Photos doesn't register/save crop changes, but will save other
When I open a photo in Microsoft Photos and crop it and save it, then Photos just doesn't register/save these changes. I can...
Read more >
Troubleshooting cropping issues - Squarespace Help Center
In site styles, use the Product Image Auto Crop tweak to choose whether the images crop to the same shape, or display at...
Read more >
Crop images in Photoshop Elements - Adobe Support
Displays the original aspect ratio of the photo when you crop. The Width and Height fields show the values that are used for...
Read more >
Image Cropping 101: The Basics | The TechSmith Blog
Probably the first thing is that when you crop an image and save it, you've destroyed the original image. For that reason, I...
Read more >
Your Complete Guide to Instagram Image Sizes (Updated 2022)
Instagram accepts images between 320px and 1080px, but there are specific guidelines for images added to Stories, posts, and IGTV. If your image ......
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