decodeThumbnail
fun decodeThumbnail(data: ByteArray, maxWidth: Int = Int.MAX_VALUE, maxHeight: Int = Int.MAX_VALUE, applyOrientation: Boolean = false, colorTarget: ColorTarget = ColorTarget.Source, cancellationCheck: () -> Unit? = null): KiteBitmap?(source)
A thumbnail that data carries, or null when it carries none (#150): for a HEIC or AVIF file, the item with a thmb reference to its primary image, and for a JPEG, the thumbnail in its EXIF. Of several, it gives the smallest that reaches maxWidth or maxHeight, else the largest, and skips one whose codec this build lacks. The thumbnail is not scaled; use scaled for an exact box. ImageInfo.thumbnailWidth gives the largest one's size.
applyOrientation turns it as decode turns the image: a HEIF thumbnail by its own irot and imir, a JPEG's by the file's EXIF orientation. colorTarget converts it through its own colour description, and cancellationCheck works as for decode.
Throws
on a malformed thumbnail
when every thumbnail needs a codec this build lacks