Skip to content

Identification of actual container format from data stream #1867

Answered by tocsoft
jubilant-enigma asked this question in Q&A
Discussion options

You must be logged in to vote

You want to use the overload that returns an IImageFormat as an out parameter.

i.e. call IImageInfo Identify(Stream stream, out IImageFormat format)

IImageFormat then gives you access to things like the default mime type or file extensions all based on the actual format and not on the file path with the wrong extension.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jubilant-enigma
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