Skip to content

Commit

Permalink
fix(android): support webp
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 authored and siguangli committed Sep 10, 2023
1 parent fb3bb12 commit 615f229
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,8 @@ public void exec() {
@Override
public void moveNode(final int rootId, final int[] ids, final int newPid, final int oldPid,
final int insertIndex) throws NativeRenderException {
LogUtils.d(TAG, "moveNode: ids " + ids + ", newPid " +
newPid + ", oldPid " + oldPid + ", insertIndex " + insertIndex + "\n ");
addUITask(new UITaskExecutor() {
@Override
public void exec() {
Expand Down Expand Up @@ -853,7 +855,7 @@ public void run() {
}
count--;
}
LogUtils.d(TAG,
LogUtils.e(TAG,
"executeUITask: size " + size + ", time " + (System.currentTimeMillis()
- start));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ public boolean isScraped() {
if (mDrawable != null) {
return false;
}
if (ImageDataUtils.isJpeg(mOptions) || ImageDataUtils.isPng(mOptions)) {
if (ImageDataUtils.isJpeg(mOptions)
|| ImageDataUtils.isPng(mOptions)
|| ImageDataUtils.isWebp(mOptions)) {
return mBitmap == null || mBitmap.isRecycled();
}
if (ImageDataUtils.isGif(mOptions)) {
Expand Down Expand Up @@ -271,7 +273,8 @@ public void decodeImageData(@NonNull byte[] data, @Nullable Map<String, Object>
// we recommend using an external drawable method to play GIF, such as android gif
// drawable.
mGifMovie = Movie.decodeByteArray(data, 0, data.length);
} else if (ImageDataUtils.isJpeg(mOptions) || ImageDataUtils.isPng(mOptions)) {
} else if (ImageDataUtils.isJpeg(mOptions) || ImageDataUtils.isPng(mOptions)
|| ImageDataUtils.isWebp(mOptions)) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
decodeImageForTarget28(data);
} else {
Expand Down

0 comments on commit 615f229

Please sign in to comment.