-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default GIF frames to ARGB_8888 and configure them via DecodeFormat.
Fixes #2396.
- Loading branch information
Showing
8 changed files
with
87 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
library/src/main/java/com/bumptech/glide/load/resource/gif/GifOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.bumptech.glide.load.resource.gif; | ||
|
||
import com.bumptech.glide.load.DecodeFormat; | ||
import com.bumptech.glide.load.Option; | ||
import com.bumptech.glide.load.Options; | ||
import com.bumptech.glide.load.ResourceDecoder; | ||
|
||
/** | ||
* Options related to decoding GIFs. | ||
*/ | ||
public final class GifOptions { | ||
|
||
/** | ||
* Indicates the {@link com.bumptech.glide.load.DecodeFormat} that will be used in conjunction | ||
* with the particular GIF to determine the {@link android.graphics.Bitmap.Config} to use when | ||
* decoding frames of GIFs. | ||
*/ | ||
public static final Option<DecodeFormat> DECODE_FORMAT = Option.memory( | ||
"com.bumptech.glide.load.resource.gif.DecodeFormat", DecodeFormat.DEFAULT); | ||
|
||
/** | ||
* If set to {@code true}, disables the GIF {@link com.bumptech.glide.load.ResourceDecoder}s | ||
* ({@link ResourceDecoder#handles(Object, Options)} will return {@code false}). Defaults to | ||
* {@code false}. | ||
*/ | ||
public static final Option<Boolean> DISABLE_ANIMATION = Option.memory( | ||
"com.bumptech.glide.load.resource.gif.ByteBufferGifDecoder.DisableAnimation", false); | ||
|
||
private GifOptions() { | ||
// Utility class. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting the same thing twice?