Skip to content

Commit

Permalink
fix: 修复gif判定异常
Browse files Browse the repository at this point in the history
  • Loading branch information
SherlockGougou committed Mar 1, 2023
1 parent cf93ca7 commit ef9357c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ allprojects {
```
dependencies {
// 添加本框架 BigImageViewPager https://github.com/SherlockGougou/BigImageViewPager
implementation 'com.github.SherlockGougou:BigImageViewPager:androidx-7.1.5'
implementation 'com.github.SherlockGougou:BigImageViewPager:androidx-7.1.6'
// 另外还需要依赖 glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ object ImageUtil {
}

fun isStaticImage(url: String, path: String): Boolean {
return isJpegImageWithMime(url, path)// jpeg
return (isJpegImageWithMime(url, path)// jpeg
|| isPngImageWithMime(url, path)// png
|| isBmpImageWithMime(url, path)// bmp
|| !isAnimImageWithMime(url, path)// 不是动图(不是webp动图、gif动图)
|| isBmpImageWithMime(url, path))// bmp
&& !isAnimImageWithMime(url, path)// 不是动图(不是webp动图、gif动图)
}
}
6 changes: 3 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "cc.shinichi.bigimageviewpager"
minSdkVersion 14
targetSdkVersion 32
versionCode 715
versionName "androidx-7.1.5"
versionCode 716
versionName "androidx-7.1.6"
}
buildTypes {
release {
Expand Down Expand Up @@ -57,6 +57,6 @@ dependencies {
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
// library
// implementation 'com.github.SherlockGougou:BigImageViewPager:androidx-7.1.5'
// implementation 'com.github.SherlockGougou:BigImageViewPager:androidx-7.1.6'
implementation project(':library')
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ private void initData() {

// 普通图片1:
i = new ImageInfo();
i.setThumbnailUrl("https://i.328888.xyz/2022/12/21/ArGOV.md.jpeg");
i.setOriginUrl("https://i.328888.xyz/2022/12/21/ArGOV.jpeg");
i.setThumbnailUrl("https://star.sea.img.one/2023/03/01/63fef5545d6b6.jpg");
i.setOriginUrl("https://star.sea.img.one/2023/03/01/63fef3fe5a07c.jpg");
imageInfoList.add(i);

// 普通图片2:
i = new ImageInfo();
i.setThumbnailUrl("https://i.328888.xyz/2022/12/21/Arded.md.jpeg");
i.setOriginUrl("https://i.328888.xyz/2022/12/21/Arded.jpeg");
i.setThumbnailUrl("https://star.sea.img.one/2023/03/01/63fef554e6408.jpg");
i.setOriginUrl("https://star.sea.img.one/2023/03/01/63fef3ff0cdfc.jpg");
imageInfoList.add(i);

// 大尺寸图片:
Expand All @@ -206,26 +206,20 @@ private void initData() {

// 长截图1:
i = new ImageInfo();
i.setThumbnailUrl("https://i.328888.xyz/2022/12/21/ArQ03.md.jpeg");
i.setOriginUrl("https://i.328888.xyz/2022/12/21/ArQ03.jpeg");
imageInfoList.add(i);

// 长截图2:
i = new ImageInfo();
i.setThumbnailUrl("https://images.zhishen.net.cn/xueshuzhi/images/problemImage/20230205/20230205235755802.png");
i.setOriginUrl("https://images.zhishen.net.cn/xueshuzhi/images/problemImage/20230205/20230205235755802.png");
i.setThumbnailUrl("https://star.sea.img.one/2023/03/01/63fef5d3374d2.jpg");
i.setOriginUrl("https://star.sea.img.one/2023/03/01/63fef5db1046e.jpg");
imageInfoList.add(i);

// 全景图片1:
i = new ImageInfo();
i.setThumbnailUrl("https://i.328888.xyz/2022/12/21/ArFZN.md.jpeg");
i.setOriginUrl("https://i.328888.xyz/2022/12/21/ArFZN.jpeg");
i.setThumbnailUrl("https://star.sea.img.one/2023/03/01/63fef55653a50.jpg");
i.setOriginUrl("https://star.sea.img.one/2023/03/01/63fef40fb5cf9.jpg");
imageInfoList.add(i);

// 全景图片2:
i = new ImageInfo();
i.setThumbnailUrl("https://i.328888.xyz/2022/12/21/ArsJw.md.jpeg");
i.setOriginUrl("https://i.328888.xyz/2022/12/21/ArsJw.jpeg");
i.setThumbnailUrl("https://star.sea.img.one/2023/03/01/63fef556078ff.jpg");
i.setOriginUrl("https://star.sea.img.one/2023/03/01/63fef40388f58.jpg");
imageInfoList.add(i);

// 动图:
Expand All @@ -234,22 +228,10 @@ private void initData() {
i.setOriginUrl("https://i0.hdslb.com/bfs/article/4421aaa8a38beeda1b195b656c883c7508f9b13d.gif");
imageInfoList.add(i);

// HEIC1:
i = new ImageInfo();
i.setThumbnailUrl("https://rexu-forum-1308280730.cos.ap-shanghai.myqcloud.com/image/2022/11/09/89be250d8fa24248aa8104816819a805.heic");
i.setOriginUrl("https://rexu-forum-1308280730.cos.ap-shanghai.myqcloud.com/image/2022/11/09/89be250d8fa24248aa8104816819a805.heic");
imageInfoList.add(i);

// HEIC2:
i = new ImageInfo();
i.setThumbnailUrl("https://rexu-forum-1308280730.cos.ap-shanghai.myqcloud.com/image/2022/11/09/b7ee61002e974ee7b693e7471351d108.heic");
i.setOriginUrl("https://rexu-forum-1308280730.cos.ap-shanghai.myqcloud.com/image/2022/11/09/b7ee61002e974ee7b693e7471351d108.heic");
imageInfoList.add(i);

// HEIC3:
// 动图:
i = new ImageInfo();
i.setThumbnailUrl("https://rexu-forum-1308280730.cos.ap-shanghai.myqcloud.com/image/2022/11/09/d36ea9faffb246809ba11b535182e7d1.heic");
i.setOriginUrl("https://rexu-forum-1308280730.cos.ap-shanghai.myqcloud.com/image/2022/11/09/d36ea9faffb246809ba11b535182e7d1.heic");
i.setThumbnailUrl("https://i.328888.xyz/2022/12/23/AQKsV.png");
i.setOriginUrl("https://s3.bmp.ovh/imgs/2023/03/01/219a4fef0bae6867.jpg");
imageInfoList.add(i);


Expand Down

0 comments on commit ef9357c

Please sign in to comment.