Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8907565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:56:59+00:00 2026-06-15T02:56:59+00:00

In a library I am writing for some infrastructure projects at work, I have

  • 0

In a library I am writing for some infrastructure projects at work, I have a method to create various scales of an image (for thumbnails etc…). However, the system that I am storing this data in is requiring a mime-type declared in the database for various reasons.

Is there a way to get a Mime type from the passed in c# Image class, or will I have to have external applications pass in the Mimetype along with the image?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:57:00+00:00Added an answer on June 15, 2026 at 2:57 am

    You can get the ImageFormat from the Image, and you can get the MIME type from the ImageCodecInfo. All you need to do is tie the two together:

    ImageFormat format = yourImage.RawFormat;
    ImageCodecInfo codec = ImageCodecInfo.GetImageDecoders().First(c => c.FormatID == format.Guid);
    string mimeType = codec.MimeType;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a library that I created with some business logic that includes writing
I am writing some PHP code to create PDFs using the FPDF library. And
Greetings all. I am writing some code using the Boost Units library and have
I'm writing some library code, and users of the library sometimes have different opinions
I have begun writing some code for a library I need. The following code
I'm writing some unit tests for a Python library and would like certain warnings
I'm writing a customized reflective library for some specialized custom domain logic, and that
I'm writing a simple Javascript library that makes use of some WebGL code. I'd
While making some final tests of a class-library that I'm writing for Windows Mobile
I am currently writing a C++ template expression library and comparing some instantiations with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.