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

  • Home
  • SEARCH
  • 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 736533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:36:57+00:00 2026-05-14T07:36:57+00:00

I have an application running on a Windows Server 2008, that is processing uploaded

  • 0

I have an application running on a Windows Server 2008, that is processing uploaded images. Currently it successfully processes about 8000 images per day, creating 11 different sizes of each image.

The problem that I have is that sometimes the application fails to load some images, I get the error “System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.”.

The upload only accepts files with a JPEG extension (jpg/jpeg/jpe) or with a JPEG MIME type, and from what I can tell those images are really JPEG images. If I look at the image file in windows explorer on the server, it can successfully extract the thumbnail from the file, but if I try to open it, I get the error message “This is not a valid bitmap file, or it’s format is not currently supported.” from Paint.

If I copy the image to my own computer, running Windows 7, there is no problem opening the image. It works in Paint, Windows Photo Viewer, Adobe Bridge, and Photoshop. If I try to load the image using Image.FromStream the same way as in the application running on the server, it loads just fine. (I have copied the file back to the server, and it still doesn’t work, so there is nothing in the copying process that changes it.)

When I look at the image information in Bridge, I see that the images are created using Picasa 3.0, but other than that I can’t see anything special about them. I haven’t yet found anyone having the same problem, or any known problems like this with the Picasa application.

Has anyone had any similar problem, or know if there is something special about images created using Picasa? Is there any image codec that needs installing on the server to handle all kinds of JPEG images?

Here is an example of an image that doesn’t load on the server: gdi-example.jpg (192 kB).

  • 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-14T07:36:58+00:00Added an answer on May 14, 2026 at 7:36 am

    From Experts exchange I got an example using a BitmapImage object to load the image and resave it to a MemoryStream. The BitmapImage can for some reason load the images that the Bitmap object can’t.

    I also had to load the data from the file and feed it to the BitmapImage as a MemoryStream, so that it wouldn’t lock the file.

    So, this is the final code (sans some logging) that I use now:

    using WpfImaging = System.Windows.Media.Imaging;
    ...
    
    byte[] data = File.ReadAllBytes(FileName);
    
    Image master;
    using (MemoryStream source = new MemoryStream(data)) {
      var img = new WpfImaging.BitmapImage();
      img.BeginInit();
      img.StreamSource = source;
      img.EndInit();
      WpfImaging.BmpBitmapEncoder encoder = new WpfImaging.BmpBitmapEncoder();
      using (MemoryStream m = new MemoryStream()) {
        encoder.Frames.Add(WpfImaging.BitmapFrame.Create(img));
        encoder.Save(m);
        master = new Bitmap(m);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 439k
  • Answers 439k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I went with a Reed-Solomon encoding system. There's a fairly… May 15, 2026 at 4:50 pm
  • Editorial Team
    Editorial Team added an answer I tried a few different automation tools myself when trying… May 15, 2026 at 4:50 pm
  • Editorial Team
    Editorial Team added an answer Although this requires explicit registration, this sounds like you want… May 15, 2026 at 4:50 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.