Skip to content

Commit

Permalink
Add clarifying comment on isAvifHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
vignesh-em committed Apr 15, 2024
1 parent dce820b commit d6ad34f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,13 @@ class DefaultImageFormatChecker : FormatChecker {
(ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, DNG_HEADER_II) ||
ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, DNG_HEADER_MM))

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

0 comments on commit d6ad34f

Please sign in to comment.