Skip to content

Image.Load<TPixel>(imageSource.Invoke(), out IImageFormat imgFormat); Alternative #2557

Answered by tocsoft
TonyValenti asked this question in Q&A
Discussion options

You must be logged in to vote

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(...) APIs

or if you can call Image.Identify(..) / Image.IdentifyAsync(..) too if you want the metadata also, then like Image.Load..(..) you access it from foo.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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TonyValenti
Comment options

Answer selected by TonyValenti
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants