Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
msisuzney committed Jan 8, 2022
1 parent 69aafc7 commit 9fd8dad
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 62 deletions.
2 changes: 2 additions & 0 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ dependencies {
implementation "com.github.bumptech.glide:annotations:${GLIDE_VERSION}"
annotationProcessor "com.github.bumptech.glide:compiler:${GLIDE_VERSION}"
implementation project(":heifdecoder")
// implementation 'com.github.msisuzney.GlideHeifDecoder:heifdecoder:0.4'

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MainActivity : Activity() {
setContentView(R.layout.activity_main)
val iv = findViewById<ImageView>(R.id.iv)
val iv2 = findViewById<ImageView>(R.id.iv2)
Glide.with(this).load(R.raw.example1).into(iv)
Glide.with(this).load(R.raw.example).into(iv2)
Glide.with(this).load(R.raw.avif_example).into(iv)
Glide.with(this).load(R.raw.heic_example).into(iv2)
}
}
30 changes: 0 additions & 30 deletions demo/src/main/res/drawable-v24/ic_launcher_foreground.xml

This file was deleted.

5 changes: 0 additions & 5 deletions demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

This file was deleted.

5 changes: 0 additions & 5 deletions demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

This file was deleted.

File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions demo/src/main/res/values-night/themes.xml

This file was deleted.

10 changes: 0 additions & 10 deletions demo/src/main/res/values/colors.xml

This file was deleted.

2 changes: 1 addition & 1 deletion demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">GlideAvifDecoder</string>
<string name="app_name">GlideHeifDecoder</string>
</resources>
2 changes: 1 addition & 1 deletion heifdecoder/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.msisuzney.glide.avifdecoder">
package="com.msisuzney.glide.heifdecoder">

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public ByteBufferHeifBitmapDecoder(HeifDownsampler downsampler, BitmapPool bitma
@Override
public boolean handles(@NonNull ByteBuffer source, @NonNull Options options) throws IOException {
HeifImageHeaderParser.HeifImageType imageType = HeifImageHeaderParser.getType(source);
return imageType == HeifImageHeaderParser.HeifImageType.AVIF || imageType == HeifImageHeaderParser.HeifImageType.HEIF;
return imageType == HeifImageHeaderParser.HeifImageType.AVIF || imageType == HeifImageHeaderParser.HeifImageType.HEIC;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static HeifImageType sniffHeif(Reader reader, int boxSize) throws IOExce
return HeifImageType.AVIF;
}
if (brand == HEIC_BRAND || brand == MIF1_BRAND) {
return HeifImageType.HEIF;
return HeifImageType.HEIC;
}
// Skip the minor version.
reader.skip(4);
Expand All @@ -103,14 +103,14 @@ private static HeifImageType sniffHeif(Reader reader, int boxSize) throws IOExce
return HeifImageType.AVIF;
}
if (brand == HEIC_BRAND || brand == MIF1_BRAND) {
return HeifImageType.HEIF;
return HeifImageType.HEIC;
}
}
return HeifImageType.NONE_HEIF;
}

public enum HeifImageType {
HEIF,
HEIC,
AVIF,
NONE_HEIF
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public StreamBitmapHeifDecoder(HeifDownsampler downsampler, ArrayPool byteArrayP
@Override
public boolean handles(@NonNull InputStream source, @NonNull Options options) throws IOException {
HeifImageHeaderParser.HeifImageType imageType = HeifImageHeaderParser.getType(source, byteArrayPool);
return imageType == HeifImageHeaderParser.HeifImageType.AVIF || imageType == HeifImageHeaderParser.HeifImageType.HEIF;
return imageType == HeifImageHeaderParser.HeifImageType.AVIF || imageType == HeifImageHeaderParser.HeifImageType.HEIC;
}

@Override
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
rootProject.name = "GlideHeifDecoder"
Expand Down

0 comments on commit 9fd8dad

Please sign in to comment.