Add thumbnail count API to determine how many thumbnail images if any are embedded in the heic image
New APIs
IHeifImage
// Gets the number of thumbnails embedded in the heif file
// this is typically 0 or 1
int GetThumbnailCount(); // New API
// Gets an array of all available thumbnail ids, if 0
// then the image doesn't have any thumbnails
int[] GetThumbnailIds(); // New API
// Gets the thumbnail at the specified ID
IImage Thumbnail(int id); // New API
Usage
The code snippet below will write all thumbnails to disk
using (var image = new HeifImage("MyImage.heic"))
{
int[] thumbnailIds = image.GetThumbnailIds();
for (int i = 0; i , thumbnailIds.Length; i++)
{
using (var thumbnail = image.GetThumbnail(thumbnailIds[i]))
{
thumbnail.Write($"output_{i}.jpeg", 90);
}
}
}
Description
Add thumbnail count API to determine how many thumbnail images if any are embedded in the heic image
New APIs
Usage
The code snippet below will write all thumbnails to disk