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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:39:42+00:00 2026-05-30T14:39:42+00:00

I am writing a program which grabs JPEG images from a camera which is

  • 0

I am writing a program which grabs JPEG images from a camera which is connected via Serial Port. I want to programmatically define an image in WPF, in order to display it once it is retreived, using the Source attribute of Image.

I have found that

image1.Source = new BitmapImage(new Uri(Environment.CurrentDirectory + @"/" + photo + ".jpg"));

Is working absolutely fine with most images, but for some reason it doesn’t like the images from this camera. Can anyone who knows more than me about JPEG please take a look at it and see why it might be a problem?

http://dl.dropbox.com/u/2434899/0%20%282%29.jpg

EDIT: After some investigation, I have determined that it is probably the JFIF header data that WPF/C# does not like. Is there any easy way to correct it in-program?

EDIT 2: I believe I have found the problem. The camera’s JFIF header data is complete junk. It’s basically just 0-10… Had to read it with a Hex editor in the end. I copied across the JFIF header from the working file and now it is fine. Just got to edit each header as it comes in, I guess.

For the information of anyone who encounters this problem with this camera:

http://www.4dsystems.com.au/prod.php?id=75

It seems to give out the same junk header information with each photo:

FF D8 FF E0 00 11 4A 46 49 46 00 01 02 03 04 05 06 07 08 09 0A FF DB

And none of it matches with anything in the JFIF standard:

http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format

It seems that if you just replace the JFIF header with this:

FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 60 00 60 00 00 FF DB

It will work. Just read the file up until the “FF DB” which is also in the junk header – it seems to be the ‘stop word’ for the header – and then swap out that for this.

There is a second lot of what would appear to be header information which continues on until byte 26E… and it seems to be the same in both of the images I have here, but it doesn’t seem to be the cause of the C# loading issue. It doesn’t look like anything in JFIF, so I am not sure.

  • 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-30T14:39:43+00:00Added an answer on May 30, 2026 at 2:39 pm

    I’m sorry to say, but I think this image is “corrupt.” I think the image stream that save this image didn’t close/dispose properly. I loaded the image in XAML and got the error:

    Exception from HRESULT: 0x88982F72

    Then I opened the image in Paint/Photoshop and re-saved it. I opened the re-saved image in XAML and no error. It looks like Photoshop read it fine and when it saved it saved it correctly

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

Sidebar

Related Questions

I am writing a program which has two panes (via CSplitter ), however I
I am writing a C# program which captures signals from a external device, and
I wrote a program which includes writing and reading from database. When I run
Writing a program in which I need to split strings from a struct linked
I'm writing a program which reads from file and send to printer to print.
I'm writing a program which must download documents from google docs. I have downloaded
I'm writing a program which has both an ASP.NET configuration system and a Silverlight
I am writing a program which if I compile on a Suse 10 32-bit
I'm writing a program which will use scan conversion on triangles to fill in
I'm writing a program which will allow to load a specific managed .DLL file

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.