-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Exception: java.io.IOException: Cannot reset #364
Comments
This has been an issue with various images and the quick bad solution was to increase the Do you have some sample urls of images failing? Try to bump it to |
As for the airplane mode that seems to be OK as a warning since the API has changed. I'll verify again today. We will be upgrading Picasso to use Gradle and API Level 19 and when we do so we will fix that warning. |
The image is a small one: http://store.indemand.com/shared/ovs/prodimages/movies/t/troublewiththecurve_ID0360906/troublewiththecurveBM_ID0360906.jpg , around 120KB. I couldn't see a method call to adjust the MARKER size, should I change that in source and compile my own jar? |
For now yes, I believe there is an issue filed to properly fix this. |
I had to increase the MARKER size to |
That seems like a wicked Android bug either in skia or one of the decoding libraries that it uses. We should file a bug. What version of Android? |
Our minSDK=14 and max/targetSDK=19. It looks like either Picasso or Android is having trouble as images get smaller. We have an even smaller thumbnail right next to the notification text when something is downloading and we weren't able to get that image to show. |
We're having the same issue, on all the Android phones I tested it on (4.4 and 4.3), and it only shows up when using Picasso. If I just use the BitmapFactory to create the same Bitmap (from the same source), it works fine. So, it's an issue specific to Picasso. @JakeWharton: could you elaborate on the "wicked Android bug" that you say is causing this, so we have a way to work around this? Increasing the MARKER size didn't make a difference in our case. Thanks! |
The metadata for every image format is present in the first 1024 bytes of the image. The images on which Android decides to read a ton of data on a metadata-only decode contain the relevant data in the first 1024 bytes. Something is causing the native decoding libraries to read much more data than they need to fulfill the metadata decode we are requesting. |
Thanks @JakeWharton! I understand the issue now. But, as far as I can see in the docs, you don't have any guarantee from the Android API's (inJustDecodeBounds) about how many bytes will be read in order to determine the image bounds. So, I don't really see how Picasso can rely on an arbitrary value (2^16; 65536) and expect it to work in all cases. It may well be an inefficient implementation on Android's part, but it seems wrong to blame them for something they don't guarantee? Additionally, even if it were a bug on Android and they fixed it, it doesn't really help Picasso users ;) (until everybody upgrades..) |
I'm looking at the implementation of bounds decoding, not the docs. It also assumes that they are in the first 1024 bytes. |
Thanks @JakeWharton! But how can Picasso rely on Android's implementation details? Or am I missing something? When you use their inJustDecodeBounds API to figure out the dimensions of the image, you should not rely on implementation details, but on the published java docs; i.e., the actual contract. They may change this implementation. As long as the API's don't specifically mention implementing this bounds decoding a certain way, any code using this API shouldn't rely on the implementation. So, clearly, it seems a bug in Picasso, not in Android. By following the published API, these problematic images can be loaded without problems. Can we expect this issue to be fixed in Picasso in some future release, or should we work around it ourselves somehow? Thanks again! |
It will be fixed. On Fri, Apr 25, 2014 at 12:03 PM, niekvse notifications@github.com wrote:
|
Hi, @JakeWharton . Correct me if i was wrong. I am not so sure about the original purpose of those 2 lines of codes . Seems like after I removed them this issue was gone. Thanks. |
My Moto G is making photos that run in to this bug on decoding. Is there a good way to fix existing bitmaps until a fix is in place? |
temporary. see square#364
Known issue and number 1 priority for 2.5.1. No more |
@dnkoutso Is there a workaround for this I could use on a fork? Also I'm trying to get some more context on the issue - you kind of commented out of the blue that it's a known issue. Is there more discussion elsewhere? We're experiencing this problem specifically on Moto X (2nd gen) loading a full-resolution capture from the camera, using resize() to cap it at 1200x1200 px. |
@jacobtabak have you tried increasing the MARKER constant in If you increase it it will work. We will be working on this to fix it once and for all. |
Thanks @dnkoutso, We're loading from disk in this case, so unless that MARKER constant is also used in the FileRequestHandler, I'm not sure that will help. We have narrowed it down to something that changed between 2.4 and 2.5. By just reverting Picasso 2.4 (and by extension re-adding the okhttp-urlconnection dependency) the issue was resolved. Unfortunately it's only happening on one device that I don't own (Moto X 2nd gen) so I can't really narrow down the exact change that broke it. |
Just fixed a similar issue in my app. Same conditions: Lollipop, ListView and Picasso for loading images in the list items. On list scroll I occasionally got SEGSEGV. And it worked on the ICS device without any issues. Problem was in this code for setting up list item:
Solved with using picasso in both cases. |
Same problem on Moto G(6.0) with Picasso version 2.5.2, but it works well with 2.6.0-SNAPSHOT. Picasso release is needed. |
This issue is well over 2 years old. Is Picasso still actively maintained? Latest commit is from 2 months ago. |
@lisandrop Here's @JakeWharton's explanation from about a month ago: https://www.reddit.com/r/androiddev/comments/4bgaci/autovalue_extensions_jake_wharton/d195t4r Does Picasso perhaps have a regular contributor outside of Square who could be given the rights to publish updates? Just an idea. |
Yeah, it's kinda sad to see this library stagnating a bit. I use it almost in all of my projects... |
It'll happen eventually. On Mon, Apr 25, 2016 at 6:00 PM dimsuz notifications@github.com wrote:
|
Upgrading to 2.5.3-SNAPSHOT fixes the issue. Thanks! |
I just upgraded to 2.5.3-SNAPSHOT as well. Fixed! |
If there is already a snapshot for 2.5.3 then does that mean v2.5.3 is coming in a few months from now? |
3.0.0 is next
…On Mon, Jan 9, 2017 at 2:15 PM Etienne Lawlor ***@***.***> wrote:
If there is already a snapshot for 2.5.3 then does that mean v2.5.3 is
coming in a few months from now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#364 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEfXGVWR76o8qMHA0BJ7rDxXdAFdwks5rQrGcgaJpZM4BbK7L>
.
|
@martygeek @Maragues cannot found 2.5.3-SNAPSHOT , @JakeWharton When will the 3.0.0 come out? |
Could someone publish whatever code is in 2.5.3-SNAPSHOT as a release version please? |
Actually wasn't fixed, still happening on 2.5.3-SNAPSHOT |
The next version is 3.0.0-SNAPSHOT, not 2.5.3-SNAPSHOT.
…On Thu, Feb 15, 2018 at 1:27 PM Dmitriy Lozenko ***@***.***> wrote:
Actually wasn't fixed, still happening on 2.5.3-SNAPSHOT
... at com.squareup.picasso.TargetAction.error(TargetAction.java:49) at
com.squareup.picasso.Picasso.deliverAction(Picasso.java:581) at
com.squareup.picasso.Picasso.complete(Picasso.java:528) at
com.squareup.picasso.Picasso$1.handleMessage(Picasso.java:117)
Unable to load Camera image from internal storage.
Picasso deliverAction(...) returns null Bitmap.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#364 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEEERexTxHukTIFC2hQgiHz-qlWe_Dkks5tVHcXgaJpZM4BbK7L>
.
|
@JakeWharton gradle cannot locate the lib: compile 'com.squareup.picasso:picasso:3.0.0-SNAPSHOT' Any suggestions? Thanks a lot |
See the README for the maven repository you must use.
…On Thu, Feb 15, 2018 at 4:11 PM vianairan ***@***.***> wrote:
@JakeWharton <https://github.com/jakewharton> gradle cannot locate the
lib: compile 'com.squareup.picasso:picasso:3.0.0-SNAPSHOT'
Any suggestions? Thanks a lot
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#364 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEeHtBBfrFDiHfXDfAS38JiDVLdDVks5tVJ14gaJpZM4BbK7L>
.
|
Thank you |
Thank you! When receiving an image from camera and resizing it with:
got this exception on Meizu U20 (Android 6.0). Upgraded to 3.0.0-SNAPSHOT (see #1739). Also changed |
Looking at the date of comments - @JakeWharton does |
@yayaa looking into the commit history #1280 with the fix is included in |
Same problem java.io.IOException: Cannot reset and yes Upgrading to 2.5.3-SNAPSHOT fixes the issue. Thanks! |
Hi Square team!
We are having an issue in an app, when in a listview, images on some rows load but some of them are blank. I tried to trace it and collect as much information as I can.
Exception
Responsible code (under getView())
By the way, I don't know if it matters but airplane mode is on, but wifi is connected. I added this because with every row loading, I am seeing this in logs:
Also the app crashed with this, after scrolling through the list up and down many times;
The app doesn't seem to crash and I also didn't see the W/Settings airplane message if I switch to
style instead of Picasso.Builder.
The text was updated successfully, but these errors were encountered: