Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hey-red committed Mar 6, 2023
1 parent fca165b commit 13e0c72
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ using HeyRed.ImageSharp.Heif.Formats.Avif;

var decoderOptions = new DecoderOptions()
{
Configuration = new Configuration(new AvifConfigurationModule())
Configuration = new Configuration(
new AvifConfigurationModule(),
new HeifConfigurationModule())
};

using var inputStream = File.OpenRead("/path/to/image.avif"); // or image.heic
using var image = Image.Load(decoderOptions, inputStream);
using var image = Image.Load(decoderOptions, "/path/to/image.avif"); // or image.heic
// Do something with image
...
Expand All @@ -56,10 +56,16 @@ By default DecodingMode set to PrimaryImage, but if you want decode all top leve
```C#
var decoderOptions = new HeifDecoderOptions
{
DecodingMode = DecodingMode.TopLevelImages
DecodingMode = DecodingMode.TopLevelImages,
// MaxFrames option is also supported
GeneralOptions = new DecoderOptions
{
MaxFrames = 10,
}
};

using var inputStream = File.OpenRead("/path/to/image.avif"); // or image.heic
using var image = HeifDecoder.Instance.Decode(decoderOptions, inputStream);

// Saves all frames
Expand Down

0 comments on commit 13e0c72

Please sign in to comment.