Re: Corrupt JPG Files



On 12 Apr, 09:10, "Martin Brown" <|||newspam...@xxxxxxxxxxxxxxxxxx>
wrote:
On Apr 11, 9:52 pm, "Mark" <n...@xxxxxxxxxxxxxxxxxx> wrote:

On 11 Apr, 21:05, ASAAR <cau...@xxxxxx> wrote:

On Wed, 11 Apr 2007 15:34:10 -0400, jimbok wrote:
Simply put, windows, upon seeing a .jpg extension, reads the file's
header. If is is - in any way incorrect - windows will reject it as a
jpg file and treat it as "unknown file type."

And Photoshop in particular will choke on a JPEG with even the tiniest
defect.


And every other Windows app I can find. :)



That may be true for windows, but I'd be surprised if all
applications are similarly fooled. Many times I've tried to view
image files (jpg, gif, etc.) using Irfanview and will see a message
stating that the file extension is incorrect and with an offer to
correctly rename the file. Whether I did or didn't allow renaming,
Irfanview then was always able to display the images.

That will work if the program understands file headers and the file
has a wrong extention. The problem here is that the file extention is
correct but the file header and very possibly the file contents have
been corrupted somehow.

Yes, but as per my OP, I tried irfanview as one the first progs. The
actual error it gives for all 9 images is "Huffman table 0x01 was not
defined".

OK that is *very* important information. No normal application will be
able to display such a file. It is missing the crucial table to tell
it how to do the initial decompress of the JPEG components. What you
have is a random sequence of compressed bits with no information about
how to interpret it! There may be a fairly simple fix, but I would
need to see a couple of sample files to determine if the fault is
easily repairable (ie if the damage is only to the header).

I did another test. I took one of the corrupt files, gave it a new
name, and copied it back to the card and then put the card back into
the camera to see if it is readable and.... voila! The camera can read
and enlarge it with no problems whatsoever. (I have since taken a
snapshot of the card, and done a test restore of the card image back
to the card and the camera can indeed read it, so now I'm not worried
about formatting the card and reusing it whilst still investigating
this problem.)


BTW, I tried "jpeg recovery" and that told me the file header was
corrupt.

And it is correct. It requires JPEG wizard tricks to read a damaged
file. I am happy to examine a couple of sample files to determine the
nature of this fault. I have never seen a fault that breaks the
Huffman tables before and I am curious to see exactly what has
happened to it. Usually most errors are in the bulk data after start
of stream.

There is indeed something that all the corrupt jpgs seem to have in
common. (OK, I didn;t go through all of them but three randomly
corrupt images had this feature that three randomly chosen ones
didn't.) There a section of data in OK images near the top that is a
big series of zeros. The corrupt ones all seem to data data there. I
did try replacing this "data" with zeros but it didn't fix the
problem.


My instinct given the large number of identical faults you have seen
is that the camera firmware is suspect.

That would be my guess. It is interesting that the firmware can read
files that no Windows software can. It must be making certain
assumptions about the format that Windows software doesn't / can't.


A typical failure rate is more like 1:10000 shots (most digicams can
sometimes glitch in a way that generates a broken JPEG file if
suitably provoked). The main way to corrupt files is by ejecting media
with the power still on and read/write in progress. Press
photographers tend to do this in the heat of the moment when a card
fills and they need to replace it quickly. Windows XP can be unkind to
removable media that is ejected unexpectedly too.

Agreed. But... in this case, I took a sequence of pictures and I can
state with 100% certainty that I didn't eject the card between or
indeed after them. :) Also, they are in the middle, not at the end of,
a bigger sequence of images. Strange.




I'll review the file header comparison thing. It's going to take a
long time as at first glance, the bytes that differ are different on
all images including those that load fine. I'll need to look closer.
Re calling HP - yes, I might give it a go but I'm not encouraged that
it is now listed as an obsolete camera. Also, last time I contacted
them about the compression settings, they didn't seem to know that the
compression level could even be changed!- Hide quoted text -

That sounds about right for HP support :(

LOL. :)


Regards,
Martin Brown

I'm just about to dash out of the house for a while but I'll email a
couple of them over if that's still OK? Might be tomorrow.

Cheers
Mark

.



Relevant Pages

  • Re: digital forensics - recovering images from a memory card with trashed file system
    ... Based on the number of images it can ... windows or mac) that may be able to ... It was a new card so that there is a chance that the ... it's not the card that's the problem it's the file system that is ...
    (Debian-User)
  • Re: Canon 30D Copy Problem
    ... the Compact Flash Card to my PC I have always used a Card reader and used ... Windows to copy the files from the card to the hard disk. ... RAW images that DPP cannot open, comes up with a message saying the file ... on screen are obviously corrupt. ...
    (rec.photo.digital.slr-systems)
  • Re: Canon 30D Copy Problem
    ... Tony Falla wrote: ... the Compact Flash Card to my PC I have always used a Card reader and used ... Windows to copy the files from the card to the hard disk. ... comes up with a message saying the file is corrupt. ...
    (rec.photo.digital.slr-systems)
  • Re: Transfer of images from memory card to PC for editing and vice ver
    ... possible or not to transfer digital images from a memory ... transferring the edited images back on to the memory card ... Description of CD-ROM Recording in Windows XP ...
    (microsoft.public.windowsxp.photos)
  • Re: Canon 30D Copy Problem
    ... Tony Falla wrote: ... the Compact Flash Card to my PC I have always used a Card reader and used ... comes up with a message saying the file is corrupt. ... also get 1 or 2 JPG images which open but when they appear on screen are ...
    (rec.photo.digital.slr-systems)