Giter Club home page Giter Club logo

glide's People

Contributors

aam avatar anpez avatar antondaubert avatar asos-savvasdalkitsis avatar brettchabot avatar conanoc avatar cushon avatar falhassen avatar glide-copybara-robot avatar hoisie avatar jaredsburrows avatar jnlopar avatar kanelbulle avatar kojilin avatar nanaze avatar paulsowden avatar renovate[bot] avatar rwliang avatar sjudd avatar skyinu avatar supercilex avatar t45k avatar tacothedank avatar technoir42 avatar timurrrr avatar tolriq avatar twisterrob avatar vanniktech avatar vigneshvg avatar xian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glide's Issues

Also pass "boolean fromCache" to the Target interface

Hi @sjudd, any objection in doing a PR to slightly change the Target interface to add the fromCache boolean?

Before I was relying in the ImageReadyCallback to set a flag in the target like:

public static class CustomImageReadyCallback<T> implements ImageReadyCallback<T>
    {
        @Override
        public void onImageReady(T model, Target target, boolean fromCache)
        {
            ((CacheableAwareImageViewTarget) target).setFromCache(fromCache);
        }
    }

The proposed approach would be:

public interface Target {
    /**
     * The method that will be called when the image load has finished
     * @param bitmap The loaded image
     * @param fromCache If the bitmap was loaded from the cache
     */
    public void onImageReady(Bitmap bitmap, boolean fromCache);
    (...)
}

But now the callback is called after the target.onImageReady. Since I have custom animations using a TransitionDrawable with a cross fade the normal setAnimation scheme doesn't work anymore.

So my big question is, any big reason why the fromCache argument could not fit in terms of the structure you initially idealized?

As an example, my current ImageViewTarget is something like this:

public static class CustomImageViewTarget extends ImageViewTarget implements CacheableAwareImageViewTarget
    {
        private final ImageView mImageView;
        private final LoaderOptions mLoaderOptions;
        private boolean mFromCache;

        public CustomImageViewTarget(ImageView imageView, LoaderOptions loaderOptions)
        {
            super(imageView);

            mImageView = imageView;
            mLoaderOptions = loaderOptions;
        }

        @SuppressWarnings("deprecation")
        private void onImageReady(final Bitmap bitmap, final boolean isImmediate, boolean isInLayoutPass)
        {
            if (isImmediate && isInLayoutPass)
            {
                mImageView.post(new Runnable()
                {
                    @Override
                    public void run()
                    {
                        onImageReady(bitmap, isImmediate, false);
                    }
                });
                return;
            }

            if (mLoaderOptions.removePlaceholder && bitmap != null)
            {
                // Cannot use the #setPlaceholder method because that method only sets the setBackgroundDrawable if the
                // drawable is a NinePatchDrawable
                mImageView.setBackgroundDrawable(null);
            }

            if (isImmediate || !mLoaderOptions.fadeIn)
            {
                mImageView.setImageBitmap(bitmap);
                return;
            }

            final Drawable currentDrawable = mImageView.getDrawable();
            final Drawable initialDrawable = currentDrawable != null ? currentDrawable : sTransparentDrawable;

            // TODO: in some cases, the bitmap is streched! Drawing in a canvas will solve this?
            final BitmapDrawable bitmapDrawable = new BitmapDrawable(mImageView.getResources(), bitmap);

            // Use TransitionDrawable to fade in
            final TransitionDrawable td = new TransitionDrawable(new Drawable[] { initialDrawable, bitmapDrawable });
            td.setCrossFadeEnabled(true);

            mImageView.setImageDrawable(td);

            td.startTransition(UIUtils.ANIMATION_FADE_IN_TIME);
        }
        @Override
        public void onImageReady(Bitmap bitmap)
        {
            final boolean isInLayoutPass = mImageView instanceof LayoutAwareImageView ? ((LayoutAwareImageView) mImageView).isInLayout() : false;

            onImageReady(bitmap, mFromCache, isInLayoutPass);
        }

        @SuppressWarnings("deprecation")
        @Override
        public void setPlaceholder(Drawable placeholder)
        {
            if (placeholder instanceof NinePatchDrawable)
            {
                mImageView.setImageDrawable(null);
                mImageView.setBackgroundDrawable(placeholder);
            }
            else
                super.setPlaceholder(placeholder);
        }

        @Override
        public void setFromCache(boolean fromCache)
        {
            mFromCache = fromCache;
        }

Thanks!

Bitmap recycling race

Bitmaps should be able to be marked pending for a specific view. Currently an ImageLoader can request an image, obtain it from the cache, and mark it not pending all before the original requester has responded to the image. This could cause the image to be added to the bitmap pool twice.

gradle build failing

The gradle build (using com.android.tools.build:gradle:0.7.3) is failing because "volley.jar" was never checked into the libs folder.

Which version of volley.jar should I use, and where can I obtain this version of the jar ?

Placeholder from a Local file or manage Cache to populate images

We need to load a local version of an Image in the first time, and update it with a remote version later. The objective is to always show a initial decent image.
We have though that manage as dinamic placeholder can do the trick, other option would be to populate the cache with the first version that we can update in the background with remote versions.
Can be any of this solution or another possible ?

Thanks,

Bypass BitmapPool for gif images

We load facebook avatars in one of our lists and it seems that some of them are GIFs.

We got some weird errors in our logs:

11-05 17:13:45.143  19634-19634/com.shazam.android E/GLIDE﹕ IP: onImageLoadException model= https://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v2/y9/r/IB7NOFmPw2a.gif
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ java.lang.IllegalArgumentException: Problem decoding into existing bitmap
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:540)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at com.bumptech.glide.resize.load.Downsampler.decodeStream(Downsampler.java:182)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at com.bumptech.glide.resize.load.Downsampler.downsampleWithSize(Downsampler.java:114)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at com.bumptech.glide.resize.load.Downsampler.downsample(Downsampler.java:98)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at com.bumptech.glide.resize.load.ImageResizer.load(ImageResizer.java:113)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.resizeIfNotFound(ImageManager.java:573)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.access$1600(ImageManager.java:466)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at com.bumptech.glide.resize.ImageManager$ImageManagerRunner$1$1$1.run(ImageManager.java:554)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-05 17:13:45.143  19634-19634/com.shazam.android W/System.err﹕ at java.lang.Thread.run(Thread.java:841)

it seems that on Android, you cannot recycle a bitmap when it comes to GIFs. See the discussion here:

https://groups.google.com/forum/#!msg/android-developers/Mp0MFVFi1Fo/e8ZQ9FGdWdEJ

Can we have Glide bypass the pool when dealing with GIFs?

Getting a lot of "java.lang.IllegalArgumentException: Cannot draw recycled bitmaps" after adding the clear memory in LruMemoryCache

After I added the MemoryCache.clearMemory and MemoryCache.trimMemory to my base activity I started getting spurious exceptions regarding the bitmaps being recycled.

After reading the source of LruMemoryCache it seems it does a simple purge of the bitmaps in the cache but I believe that at this point there are still views with a reference to a BitmapDrawable containing the Bitmap and as soon as the draw method is called they will crash.

Is there a possibility to check if the bitmap is being used before purging it so that we only remove bitmaps that aren't currently being used?

Crashes when matchparent/wrapcontent

when imageview width is match_parent
imageview height is wrap_content then the imageview fails to load the image and crashes when we give .into(ImageView)

Gif support

I'm using a custom GifDrawable wich incorporates with GifDecoder which knows how to get next frame/delay and works with stream of bytes to display animated gifs. So I would like to integrate your library to my project to support gif loading and animation. Could you please point me on how I can achive this?

ImageResizer requires two InputStreams

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.

Getting IllegalArgument exception several times

When I scroll the listview (with a 4 images in a row) up and down for a while it throws me this error.

09-26 14:32:31.233: E/AndroidRuntime(15158): FATAL EXCEPTION: bg_thread
09-26 14:32:31.233: E/AndroidRuntime(15158): java.lang.IllegalArgumentException: Problem decoding into existing bitmap
09-26 14:32:31.233: E/AndroidRuntime(15158):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at com.bumptech.glide.resize.load.Downsampler.decodeStream(Downsampler.java:182)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at com.bumptech.glide.resize.load.Downsampler.downsampleWithSize(Downsampler.java:114)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at com.bumptech.glide.resize.ImageManager$1.downsample(ImageManager.java:78)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at com.bumptech.glide.resize.load.ImageResizer.load(ImageResizer.java:113)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at com.bumptech.glide.resize.load.ImageResizer.load(ImageResizer.java:101)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.getFromDiskCache(ImageManager.java:527)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.run(ImageManager.java:510)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at android.os.Handler.handleCallback(Handler.java:605)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at android.os.Handler.dispatchMessage(Handler.java:92)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at android.os.Looper.loop(Looper.java:137)
09-26 14:32:31.233: E/AndroidRuntime(15158):    at android.os.HandlerThread.run(HandlerThread.java:60)

Wrapped views must not use wrap_content

Glide will not start loading images for views whose layout_width and/or layout_height are set to wrap_content. Though most resize options don't really make sense with wrap_content, some do (like AsIs) so ImageLoaders should be able to handle those dimensions.

Disk cache images as-is

When images are written to disk looks like they are compressed to jpeg. Am I missing anything? Is there any way to save images as-is? From my download I am getting few transparent png's which appear with darkened in place of transparent image.

Out of memory error

The code on my application class is below.

public void setImageManager(){
    final Glide glide = Glide.get();
    if (!glide.isImageManagerSet()) {
        File cacheDir = ImageManager.getPhotoCacheDir(this, CACHE_NAME);
        DiskCache diskCache;
        try {
            diskCache = DiskLruCacheWrapper.get(cacheDir, 50 * 1024 * 1024);
        } catch (IOException e) {
            e.printStackTrace();
            diskCache = new DiskCacheAdapter();
        }


        ImageManager.Builder builder = new ImageManager.Builder(this);
        builder.decodeBitmapOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;
        builder.setBitmapCompressFormat(CompressFormat.PNG);
        builder.setDiskCache(diskCache);
        glide.setImageManager(builder);
    }
}

The below is my stacktrace.

09-11 16:57:06.589: E/dalvikvm-heap(14859): Out of memory on a 614860-byte allocation.
09-11 16:57:06.589: I/dalvikvm(14859): "Thread-7971" prio=5 tid=16 RUNNABLE
09-11 16:57:06.589: I/dalvikvm(14859):   | group="main" sCount=0 dsCount=0 obj=0x41806198 self=0x18281d0
09-11 16:57:06.589: I/dalvikvm(14859):   | sysTid=14940 nice=10 sched=0/0 cgrp=bg_non_interactive handle=25318736
09-11 16:57:06.599: I/dalvikvm(14859):   | schedstat=( 1411041240 6718078644 17923 ) utm=104 stm=37 core=0
09-11 16:57:06.709: I/dalvikvm(14859):   at java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:~122)
09-11 16:57:06.849: I/dalvikvm(14859):   at com.android.volley.toolbox.BasicNetwork.entityToBytes(BasicNetwork.java:215)
09-11 16:57:06.859: I/dalvikvm(14859):   at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:104)
09-11 16:57:06.869: I/dalvikvm(14859):   at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:105)
09-11 16:57:07.119: E/AndroidRuntime(14859): FATAL EXCEPTION: Thread-7971
09-11 16:57:07.119: E/AndroidRuntime(14859): java.lang.OutOfMemoryError
09-11 16:57:07.119: E/AndroidRuntime(14859):     at java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:122)
09-11 16:57:07.119: E/AndroidRuntime(14859):    at com.android.volley.toolbox.BasicNetwork.entityToBytes(BasicNetwork.java:215)
09-11 16:57:07.119: E/AndroidRuntime(14859):    at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:104)
09-11 16:57:07.119: E/AndroidRuntime(14859):    at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:105)

Clear cache ?

The application cache keeps growing past the 50mb mark for diskcache, should we write a logic ourselfs to clear the cache in the onTrimMemory() ?

Logging statements (like the ones in the LruBitmapPool) make the app drop frames

Even when everything is being done asynchronously the logging still block the app (maybe due to some internal locking mechanism) and cause several frames to be dropped. In a S4 I notice between 100-500ms lag. Adding a simple !DEBUG in the Log.v and Log.v helped a lot!

This is more visible when you have a lot of small bitmaps (15-20) in your Listview.

A more elegant solution can be implemented in the Glide.init call for instance.

diff --git a/library/src/com/bumptech/glide/util/Log.java b/library/src/com/bumptech/glide/util/Log.java
index 161a403..e2faea6 100644
--- a/library/src/com/bumptech/glide/util/Log.java
+++ b/library/src/com/bumptech/glide/util/Log.java
@@ -8,6 +8,7 @@ import java.util.Date;

 public class Log {
     private static final String TAG = "GLIDE";
+    public static boolean DEBUG = false;

     @SuppressLint("SimpleDateFormat")
     private static final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
@@ -33,12 +34,18 @@ public class Log {
     }

     public static void d(String message, Object... args) {
+        if (!DEBUG)
+            return;
+
         String formatted = args.length > 0 ? String.format(message, args) : message;
         formatted = "[" + dateFormat.format(new Date()) + "] " + formatted;
         android.util.Log.d(TAG, formatted);
     }

     public static void v(String message, Object... args) {
+        if (!DEBUG)
+            return;
+
         String formatted = args.length > 0 ? String.format(message, args) : message;
         android.util.Log.v(TAG, formatted);
     }

Not possible load image on ImageView with WRAP_CONTENT?

We are getting this exception while running our acceptance tests:

11-07 17:13:45.324    2956-2956/com.shazam.android W/System.err﹕ java.lang.IllegalArgumentException: class com.bumptech.glide.loader.image.ImageManagerLoader cannot handle width=-2 and/or height =-1

It seems that our ImageView has width = WRAP_CONTENT and height = MATCH_PARENT.

From the code, I can see that Glide will throw an exception if the following is not true:

width >= 0 && height >= 0 ||
                (downsampler == Downsampler.NONE && (width == WRAP_CONTENT || height == WRAP_CONTENT));

Is there no way for Glide to determine that the target is an imageview that has been laid out and retrieve the dimensions from it directly?

From a quick glance, that would require quite deep changes to the model unless I am missing something

Possible disc cache key conflict - Wrong image returned

I'm using Glide to load a lot of images and I'm getting sometimes a user profile picture instead of a country flag. Even after killing the process it is repetitive on the same page. I already saw this situation 2/3 times so my guess is that there should be a clash in the generator of the disc cache key.

View recycle causes multiple loads in same view if scrolled really fast in a grid

If i have really big grid say with 500 items and i scroll really fast Glide asynch load obviously lags (that is the as expected) , but as soon as scrolling stops Glide tries to load urls in the one grid cell one by one multiple times.

I am sure there is elegant solution that you can suggest and pardon my ignorance here.

One idea was to use viewholder and set a position variable which can be checked by glide each time before loading.but i am not sure where i can do that in Glide , in requestlistener?

thanks for help

Use a consistent style

Code style is all over the place, I should make sure I'm following something consistent.

IllegalArgument IP:null

Glide doesn't download few image urls and throws this exception but the image exists when I hit the url.

10-18 16:13:00.120: E/GLIDE(1938): IP: onImageLoadException model= http://d1zkqjnzjf7z4q.cloudfront.net/public/images/product_images/55905/medium/4652a87ce1a3f600a63c54ed7e59ec52.jpg
10-18 16:13:00.120: W/System.err(1938): java.lang.IllegalArgumentException: IP: null result, sampleSize=1
10-18 16:13:00.120: W/System.err(1938):     at com.bumptech.glide.resize.load.Downsampler.decodeStream(Downsampler.java:187)
10-18 16:13:00.120: W/System.err(1938):     at com.bumptech.glide.resize.load.Downsampler.downsampleWithSize(Downsampler.java:114)
10-18 16:13:00.120: W/System.err(1938):     at com.bumptech.glide.resize.load.Downsampler.downsample(Downsampler.java:98)
10-18 16:13:00.120: W/System.err(1938):     at com.bumptech.glide.resize.load.ImageResizer.load(ImageResizer.java:113)
10-18 16:13:00.120: W/System.err(1938):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.resizeIfNotFound(ImageManager.java:573)
10-18 16:13:00.120: W/System.err(1938):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.access$4(ImageManager.java:572)
10-18 16:13:00.120: W/System.err(1938):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner$1$1$1.run(ImageManager.java:554)
10-18 16:13:00.120: W/System.err(1938):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
10-18 16:13:00.120: W/System.err(1938):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-18 16:13:00.120: W/System.err(1938):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-18 16:13:00.120: W/System.err(1938):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-18 16:13:00.120: W/System.err(1938):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-18 16:13:00.120: W/System.err(1938):     at java.lang.Thread.run(Thread.java:856)

Handle exif rotation

There isn't a great way to do this with transformations alone since depending on the rotation (90 or 270 degrees) we will need to change how we downsample images.

Access to internal BitmapPool

I was wondering if it would be possible to expose the BitmapPool held implicitly by the ImageHandler through the ImageResizer reference.

Basically, what I am after, is to reuse the instance of the pool that Glide is using internally. in my own transformations so that I do not generate Bitmaps that could be reused later on by the system.

Returning a bitmap

Is there a way to return a bitmap using glide? How would I go about this?

Looking for a way to handle error

It could be great if there's a ErrorListener to check and handle errors. I'm in a situation where I could get Javascript/JS files along with images.

If the downsampler couldn't downsample it would be great if I could get a error listener.

10-11 14:01:28.096: W/System.err(9884): java.lang.IllegalArgumentException: IP: null result, sampleSize=1
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.load.Downsampler.decodeStream(Downsampler.java:184)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.load.Downsampler.downsampleWithSize(Downsampler.java:114)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.load.Downsampler.downsample(Downsampler.java:98)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.load.ImageResizer.load(ImageResizer.java:113)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.resizeIfNotFound(ImageManager.java:573)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.access$1600(ImageManager.java:466)
10-11 14:01:28.106: W/System.err(9884):     at com.bumptech.glide.resize.ImageManager$ImageManagerRunner$1$1$1.run(ImageManager.java:554)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-11 14:01:28.106: W/System.err(9884):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-11 14:01:28.106: W/System.err(9884):     at java.lang.Thread.run(Thread.java:856)

ImageManager help?

I am having trouble doing this:

public void onCreate(Bundle savedInstanceState) {
    final Glide glide = Glide.get();
    if (!glide.isImageManagerSet()) {
        glide.setImageManagerBuilder(new ImageManager.Builder(this)
            .setXyzOption()
            ...
            .build()
        );
    }
}

For some reason, it keeps telling me (this) is wrong.

Cookie Support

I haven't really used Glide yet. How do I set headers and use cookies?

SafeKeyGenerator Issue

For some reason, getSafeKey function is generating bad keys and I'm getting this exception:

E/AndroidRuntime(27304): FATAL EXCEPTION: bg_thread
E/AndroidRuntime(27304): java.lang.IllegalArgumentException: keys must match regex [a-z0-9_-]{1,64}: "????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????"
E/AndroidRuntime(27304):    at com.jakewharton.disklrucache.DiskLruCache.validateKey(DiskLruCache.java:660)
E/AndroidRuntime(27304):    at com.jakewharton.disklrucache.DiskLruCache.get(DiskLruCache.java:406)

When I debug through the function every key that's getting generated is just a long string of whitespace.

IllegalArgumentException in BitmapFactory.decodeStream

  • In some rare situations the BitmapFactory can throw a IllegalArgumentException when ever the opts.inBitmap is not null and the native part of the decoder returns a null. My impression is that either there is a rare problem with the bitmap pool (wrong dimensions or no more space available) or the image might have a different config (png vs gif for instance will break).
java.lang.IllegalArgumentException: Problem decoding into existing bitmap
    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:540)
    at com.bumptech.glide.resize.load.Downsampler.decodeStream(Downsampler.java:165)
    at com.bumptech.glide.resize.load.Downsampler.downsampleWithSize(Downsampler.java:114)
    at com.bumptech.glide.resize.ImageManager$1.downsample(ImageManager.java:80)
    at com.bumptech.glide.resize.load.ImageResizer.load(ImageResizer.java:111)
    at com.bumptech.glide.resize.load.ImageResizer.load(ImageResizer.java:99)
    at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.getFromDiskCache(ImageManager.java:540)
    at com.bumptech.glide.resize.ImageManager$ImageManagerRunner.run(ImageManager.java:523)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.os.HandlerThread.run(HandlerThread.java:61)

Patch here: onefootball-archive@0c8659e

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.