Skip to content

Commit d6ad34f

Browse files
committed
Add clarifying comment on isAvifHeader
1 parent dce820b commit d6ad34f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,13 @@ class DefaultImageFormatChecker : FormatChecker {
271271
(ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, DNG_HEADER_II) ||
272272
ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, DNG_HEADER_MM))
273273

274+
/**
275+
* Checks if [imageHeaderBytes] contains 'avif'.
276+
*
277+
* This check may not be sufficient, though it works for most AVIF images.
278+
* Details on AVIF can be found [here](https://aomediacodec.github.io/av1-avif/).
279+
* */
274280
private fun isAvifHeader(imageHeaderBytes: ByteArray): Boolean {
275-
// This check may not enough
276281
return imageHeaderBytes
277282
.toString(Charset.forName("UTF-8"))
278283
.contains("avif")

0 commit comments

Comments
 (0)