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

ImageResizer requires two InputStreams #2

Closed
sjudd opened this issue Jul 16, 2013 · 1 comment
Closed

ImageResizer requires two InputStreams #2

sjudd opened this issue Jul 16, 2013 · 1 comment

Comments

@sjudd
Copy link
Collaborator

sjudd commented Jul 16, 2013

This hasn't been a problem for us internally since we typically are loading images from files and so only have to open a second InputStream. It is however a more substantial problem for users who might want to load images via http where two separate calls would be required.

We originally required two InputStreams because using mark and reset on a BufferedInputStream to determine the size would occasionally throw a "Mark has been invalidated" IOException.

Having determined the reason why occurred so frequently (see https://code.google.com/p/android/issues/detail?id=57578&q=BitmapFactory&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars and), we should be able to revert back to using a single InputStream.

@sjudd
Copy link
Collaborator Author

sjudd commented Jul 18, 2013

Fixed in one_input_stream branch

@sjudd sjudd closed this as completed Jul 18, 2013
SZn007 referenced this issue Apr 29, 2019
Engine acquires it's lock, then the EngineResource lock when it loads
resources from cache or active resources. EngineResource acquires its
lock, then the EngineLock, when a resource is cleared. This conflicting
lock order leads to deadlock.

The fix is similar to the fix applied in ActiveResources. We always make
sure that the Engine (listener) lock is acquired before the
EngineResource lock.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=233861929
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant