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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:48:15+00:00 2026-06-13T16:48:15+00:00

I have a valid jpeg frame that is taken from a camera: http://www.developerinabox.com/test.jpg I’m

  • 0

I have a valid jpeg frame that is taken from a camera:

http://www.developerinabox.com/test.jpg

I’m loading this with the below (example) code:

using System.Net;
using System.Drawing;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            WebRequest req = WebRequest.Create("http://www.developerinabox.com/test.jpg");
            req.Timeout = 5000;
            WebResponse resp = null;


            resp = req.GetResponse();
            if (resp != null)
            {
                var s = resp.GetResponseStream();
                if (s != null)
                {
                    Image img = Image.FromStream(s); //<-- Error thrown here
                }
            }


        }
    }
}

In windows XP/Vista/7 this works fine.

In windows 8 it’s failing with “generic error in gdi+” I’ve tried loading it via WPF with the same result.

I can display the image on my windows 8 PC in google chrome but not in IE. It will display in both on windows XP/Vista/7.

I can open it on my Windows 8 box in Fireworks but trying to open it in paint gives me:

“This is not a valid bitmap file, or its format is not currently supported.”

Any ideas?

  • 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-13T16:48:16+00:00Added an answer on June 13, 2026 at 4:48 pm

    Actually, it is an invalid JPEG image but, as you can see, many applications can decode this image seamlessly. This JPEG image has a bogus SOS marker (sorry for the technical information), this Scan header (SOS) says that this image has 1 color component but the Frame header (SOF, which appears before the SOS in the JPEG file structure) claims that it’s a 3 components image.

    So the Scan header has less information than required but the missing information can be replaced with default values and the JPEG image should be decoded with no issues, which is exactly what is happening. The missing information are the Huffman table indices and default sets of these indices can be assumed based on the JPEG coding type (sequential, progressive or lossless).

    Well, it seems that Win8 is stricter when it comes to JPEG decoding. If you are curious you can take a look to this code I uploaded for another JPEG related issue (it’s coded in VB.NET) and you can debug it to know where the problem is (you should check JPEG specifications as well).


    EDIT: It was a valid JPEG image after all

    This JPEG is a baseline multi-scan sequential image (similar to a planar image), not to be confused with a progressive image (which is similar to an interlaced image). So this JPEG has a smaller Scan header because the image is decoded one component at a time. Thus, this file has 3 non-contiguous Scan headers (SOS for 1st component, compressed data, SOS for 2nd component, compressed data,...), and each scan header has information for a single component.
    Finally, if the problem was an incomplete or bogus scan header there would be a workaround (you could fix a bogus SOS header) but this is not the case. So you could make a request to the MS guys asking for support for multi-scan sequential JPEG images on Win8 😉 or use some third-party JPEG decoding library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an image upload input that only accepts PNG, JPG/JPEG, GIF images.
I have a valid SAML 2 token from my application IdP: When I try
I have a valid link that goes to a picture located on my web
My problem involves checking if I have a valid database connection before reading from
I'm writing a Win32-based application that displays jpeg images from a database. I picked
I have successfully made an app that sends a request from my Windows Phone
I'm trying to write a query to tell me which orders have valid promocodes.
Is there any way to enclose <style> tags within <body> and still have valid
I have a valid reason for wanting to do this, but it's a long
I have a valid developer profile. I could run and debug my app in

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.