Thread: JPEG corruption fix?

  1. #1
    Syncopated Kestrel andrew.bolster's Avatar
    Join Date
    Nov 2007
    Location
    Belfast
    Posts
    45

    JPEG corruption fix?

    Ok, I've bin rearranging my backup server (ironic as it seems) by copying the entire contents from an NTFS drive, over the network to another machine, wiping the NTFS drive and reformatting as ext3 so i dont have a horriffic data read overhead.
    During this transition, some pictures have become corrupted whereby it looks as if only one section of the data is corrupted but has been thrown out so the rest of that line and all of the image following it is "offset"

    Has anyone encountered this before? am i screwed? I've searched around for a solution but other solutions eg JpegRecovery dont work, that and of course i dont wanna pay for it.

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    You are most likely not screwed, but fixing the images isn't easy. You will have to figure out which byte in the image that has been changed (by studying the JPEG file format and looking at the image) and then try to change it so the next 8x8 blocks aren't affected.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    Syncopated Kestrel andrew.bolster's Avatar
    Join Date
    Nov 2007
    Location
    Belfast
    Posts
    45
    oh, the joy of hex editing then? anyone got any particular fav editors or anything that can make this a bit simpler without re-learning the jpeg format codes?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Is it only jpg files which have been corrupted ?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Syncopated Kestrel andrew.bolster's Avatar
    Join Date
    Nov 2007
    Location
    Belfast
    Posts
    45
    yeah, and its only a couple, as, typically, out of a collection of hundreds of photographs, its ones i like too.
    Actually, to answer your question more accurately, it is only *.jpg's, and while most are fairly large (2560*1920) some are small(ish) (453*604)
    Just dumb luck i guess
    Last edited by andrew.bolster; 01-07-2008 at 04:47 PM. Reason: Spelling, my grandmother would kill me

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    I don't suppose it's anything as simple as it "believing" they were text files at some point, and random occurrences of '0x0a' have been turned into '0x0d 0x0a' (or vice-versa).

    Most of the time when I do mass copying, I also compute and compare the md5sum results as well.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Heap corruption detected. What does it mean?
    By franziss in forum C++ Programming
    Replies: 17
    Last Post: 07-23-2008, 02:50 AM
  3. C++ code need help to fix
    By McReal in forum C++ Programming
    Replies: 9
    Last Post: 05-12-2007, 02:48 PM
  4. C++ Equivalent JPEG Functions?
    By stickman in forum C++ Programming
    Replies: 9
    Last Post: 05-06-2006, 10:50 AM
  5. JPEG from resource with GDI+
    By lord mazdak in forum Windows Programming
    Replies: 4
    Last Post: 04-05-2006, 04:23 PM