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 7511027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:25:12+00:00 2026-05-29T23:25:12+00:00

For instance, here is sample JPEG which I cannot SAVE (!) but can read

  • 0

For instance, here is sample JPEG which I cannot SAVE (!) but can read (e.g. find out width and height) using standard dotnet classes. Original file:

http://dl.dropbox.com/u/5079317/184809_1_original.jpg

After saving same image in windows image editor, all works great:
http://dl.dropbox.com/u/5079317/184809_1_resaved.jpg

I noticed this bug long time ago but it wasn’t major problem. But in current project I have thousands of such images and i really need some kind of solution.

Which 3rd party libraries could be used?

Here is how I am reading:

public ImageFile SaveImage(HttpPostedFileBase file, string fileNameWithPath, bool splitImage, out string errorMessage)
{
  try
  {
    using (var stream = file.InputStream)
    {
      using (Image source = Image.FromStream(stream))
      {
        return SaveImage(source, fileNameWithPath, splitImage, out errorMessage);
        // which actually do source.Save(fileNameWithPath, ImageFormat.Jpeg);
        // Exception: A generic error occurred in GDI+.
      }
    }
  }
  catch (Exception e)
  ...
}
  • 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-05-29T23:25:13+00:00Added an answer on May 29, 2026 at 11:25 pm

    Resizing of original image to same size solves problem:

    Image img2 = FixedSize(source, source.Width, source.Height, true);
    img2.Save(path, ImageFormat.Jpeg);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Bit confused here, I have an on-demand instance but do I get charged even
I have a lot of jpeg files with varying image size. For instance, here
I can't trace whats inside holderMC, and its content. What's wrong here? instance.text=something holderMC.addChild(instance)
I have some sample code which is using factories. I'd like to clean up
Here's a simple method with a foreach loop: IEnumerable<XElement> FieldsToXElements(object instance) { var fieldElements
Is it possible to have default arguments in MATLAB? For instance, here: function wave(a,
For instance, my query is like the following using SQL Server 2005: SELECT *
For instance, winsock libs works great across all versions of the visual studio. But
So here’s the challenge. Given 2 integers named a and b: // Find the
I was wondering how it can be that iterating through an NSMutableArray works, but

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.