On one of my pet projects I’m using ImageSharp to manipulate images. It is a great library that comes with a lot of features in it. And performance and memory usage is good which is quite important when manipulating images.
Remark: Be aware that a commercial license is needed in some conditions. So check out the pricing page before adding this library to your application.
I decided to add some new stuff but before I did that I updated the library to the latest version. However after doing that my original code no longer compiled. Let’s see how we can fix this…
Here is the original code:
This specific overload no longer exists in the latest version. So I started to update my code to a supported overload:
Remark: Notice that I also switched to an async overload but know that a synchronous version exists as well.
However by doing that I no longer had the format information available. The good news is that this information could now be accessed through the image.Metadata
property:
The compiler was happy again and I as well as I could continue coding.
More information
SixLabors/ImageSharp: :camera: A modern, cross-platform, 2D Graphics library for .NET (github.com)