Skip to content

Commit

Permalink
Upgraded SixLabours.ImageSharp in Statiq.Images
Browse files Browse the repository at this point in the history
Added OutputAsWebp to MutateImage
  • Loading branch information
shmatt authored and daveaglick committed Dec 5, 2022
1 parent 1a8bd58 commit ca7a49c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/extensions/Statiq.Images/MutateImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ public MutateImage OutputAsBmp()
return this;
}

/// <summary>
/// Outputs the image as WebP. This will override the default
/// behavior of outputting the image as the same format.
/// </summary>
/// <returns>The current module instance.</returns>
public MutateImage OutputAsWebp()
{
_operations.Peek().OutputActions.Add(
new OutputAction((i, s) => i.SaveAsWebp(s), x => x.ChangeExtension(".webp")));
return this;
}

/// <summary>
/// Allows you to specify an alternate output format for the image.
/// For example, you might use this if you want to full specify the encoder and it's properties.
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/Statiq.Images/Statiq.Images.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageTags>Statiq Static StaticContent StaticSite Blog BlogEngine Images ImageProcessor</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\Statiq.Common\Statiq.Common.csproj" />
Expand Down

0 comments on commit ca7a49c

Please sign in to comment.