Image.Load<TPixel>(imageSource.Invoke(), out IImageFormat imgFormat);
Alternative
#2557
-
I currently have this code:
In the latest version of ImageSharp, this method has gone away. What is the right way for me to determine the image format of the image? Specifically, I only need to know if the loaded image is transparent or not. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
we got rid of the out overloads, that information is now available in the images metadata If you just want the format that can be done using the or if you can call This change was introduced to allow both our async and sync apis to have and identical signatures to normalise the patterns you have to follow to get those details. |
Beta Was this translation helpful? Give feedback.
we got rid of the out overloads, that information is now available in the images metadata
image.Metadata.DecodedImageFormat
if you need both the image and the format.If you just want the format that can be done using the
Image.DetectFormat(...)
/Image.DetectFormatAsync(...)
APIsor if you can call
Image.Identify(..)
/Image.IdentifyAsync(..)
too if you want the metadata also, then likeImage.Load..(..)
you access it fromfoo.Metadata.DecodedImageFormat
This change was introduced to allow both our async and sync apis to have and identical signatures to normalise the patterns you have to follow to get those details.