MajorGeeks Support Forums

Go Back   MajorGeeks Support Forums > ----------= PC, Desktop and Laptop Support =---------- > Software
Register FAQ Members List Calendar Casino Mark Forums Read

Software Software such as operating systems like Windows XP, Windows Vista, Windows 7 etc., or specific programs.


Reply
 
Thread Tools Display Modes
  #1  
Old 09-19-08, 18:39
dlb's Avatar
dlb dlb is offline
Major Geek
 
Join Date: Sep 2007
Posts: 8,568
Thanks: 422
Thanked 868 Times in 738 Posts
Default corrupt jpg headers

Long story, so bear with me....
WinXP Home SP2. I guy brought me his PC because it was running slow. I scanned for and removed some minor adware (MyWeb/MySmilies and the like, nothing major). Performed general maintenance including CCleaner (HD & reg) and IObit defrag. He had some corrupt drivers (or they weren't installed correctly in the first place) so I fixed those, mainly the wifi driver and how it was configured. The PC now runs really fast. BUT- he claims that something I did somehow "broke some of his pictures". He has a BUNCH of photos on his PC. Wouldn't you know it: the most important pictures - wedding pics - have corrupt headers. There's maybe 15 different picture folders in My Pictures, and 4 or 5 of these folders have corrupt JPG headers, the other folders are fine. He's a bit PO'd at me, but I don't see how I could have possibly corrupted the headers by doing stuff I've done to hundreds of other PCs without any problems, ever. This is a first for me. I've had corrupt headers before on one PC, once, and that PC had all sorts of other problems and other corrupt files. The current PC is running perfectly except for the 4 or 5 folders where the pictures don't open. I've tried IrfanView and XnView with no luck; they both say something about the file type could not be determined or the JPG header is corrupt. I read that someone used XnView to repair the header. How? Is there any other tool out there that will repair the header? I'm at a loss with this. If I don't find a fix here at MG, I'm not sure how to proceed. I'm going to continue searching the web, but hopefully one of you fine MG members will help me out!
THANKS!
Reply With Quote
Sponsored links
  #2  
Old 09-20-08, 10:38
DavidGP's Avatar
DavidGP DavidGP is offline
MajorGeeks Forum Administrator - Grand Pooh-Bah
 
Join Date: Jan 2002
Location: UK
Posts: 38,832
Thanks: 3,008
Thanked 3,105 Times in 2,819 Posts
Default Re: corrupt jpg headers

Hi dlb

To be honest the JPEGs could have been corrupted by the malware.

Not got a MAC handy have you as this may help http://www.tow.com/software/jpeg-jfif_repair/

Not found any free apps to do this and some methods to repair corrupted headers end up with you having to use a Hex editor and edit the corrupted header with a legit jpeg header, but this is not easy to get the correct header data as the header data would need to be from same camera that took these pictures.

I know that most start with the hex code of FF D8 FF but after that it depends on the method used to take the image.

At times Photoshop is able to open and allow you to save the file which fixes it, if you dont have PS then drop me a PM and I will give you my email address to send a sample to and I will give it a go.
Reply With Quote
  #3  
Old 09-20-08, 14:42
plodr's Avatar
plodr plodr is offline
Major Geek Extraordinaire
 
Join Date: Sep 2007
Location: at my computer
Posts: 14,352
Thanks: 204
Thanked 2,609 Times in 2,415 Posts
Default Re: corrupt jpg headers

Also remind him that he should be burning his pictures (if they are that important) to a CD because if his hd died, he wouldn't be able to recover any of his snapshots, in all probability! I always copy from my camera cards to my computer, burn to a CD then I start to edit them after I'm sure I have a hard copy archived.
__________________
7" ASUS eeepc lubuntu 14.04
Aspire V5 7 HomePremium
Reply With Quote
  #4  
Old 09-20-08, 17:16
dlb's Avatar
dlb dlb is offline
Major Geek
 
Join Date: Sep 2007
Posts: 8,568
Thanks: 422
Thanked 868 Times in 738 Posts
Default Re: corrupt jpg headers

Quote:
To be honest the JPEGs could have been corrupted by the malware
That was the first thing that I told him! Now that I've had some time to think about it and remember (I first worked on the PC about 10 days ago) he brought in two PCs. The first one had the minor malware issues. The 2nd one, this one with the messed up JPG headers, had a worse malware issue. It wasn't crazy-bad, but it was more than just some MyWeb type of stuff.
Quote:
most start with the hex code of FF D8 FF but after that it depends on the method used to take the image
Yup. I have opened some of the working pics in a hex viewer, and compared the opening bytes to one of the messed up pics. The difference is obvious. What I'm trying to figure out is where the header stops, and the picture begins. If I can copy the opening string of bytes from the healthy pics and stick into the opening of the corrupt pics, therefore overwriting the corruption with a valid header, it should work, right? All the working pics I've opened in hex have the same info and were created by the same camera (a Sony; I don't have the exact model number handy).
Quote:
he should be burning his pictures (if they are that important) to a CD because if his hd died, he wouldn't be able to recover any of his snapshots
Just about every PC these days has at least a CD burner, if not a DVD burner. These PCs all have software for burning CDs and DVDs, and Windows XP and Vista have built-in burning capability. I would say 85% of the people that I do work for DO NOT back up their important data. Be it pictures, music, family movies, whatever. They NEVER back it up! And they bring me these completely screwed up PCs and it's always "I can't lose any of the pictures!! They're VERY important and I have to keep them!!! No, I didn't back them up. Burn a CD? How do you burn a CD? I have a CD burner?" or it's "... yeah, I should have backed it up, but it takes too long. I have like 150 full albums of music." They never think of backing it up as they go. It's amazing and it drives me crazy!!!!
Enough of the rant!
So, I'm going to try to copy the valid header info from the healthy pics into the corrupt header on the corrupt pics. My question now is this:
How can I tell where the header stops and the pictures begins?
Reply With Quote
  #5  
Old 09-20-08, 18:20
Cat_w_9_lives's Avatar
Cat_w_9_lives Cat_w_9_lives is offline
Major KittyCat
 
Join Date: Dec 2006
Location: Chicago
Posts: 1,854
Thanks: 19
Thanked 111 Times in 109 Posts
Default Re: corrupt jpg headers

This looks like it might help.

http://forums.dpreview.com/forums/re...ssage=27290822

Original post re above post:
http://forums.dpreview.com/forums/re...ssage=10291113

BTW, you're nice to take the time to do this. Your customer is an ingrate and most likely pics were corrupted long ago and he had not looked at them until now, or knew they were corrupt and getting you to fix for free.

Other info if needed...

http://newsgroup.xnview.com/viewtopic.php?t=15601

http://www.impulseadventure.com/photo/jpeg-snoop.html
Reply With Quote
Sponsored links
  #6  
Old 09-21-08, 14:07
dlb's Avatar
dlb dlb is offline
Major Geek
 
Join Date: Sep 2007
Posts: 8,568
Thanks: 422
Thanked 868 Times in 738 Posts
Default Re: corrupt jpg headers

Quote:
most likely pics were corrupted long ago and he had not looked at them until now, or knew they were corrupt and getting you to fix for free.
I've thought about this, and I think they may have been corrupted before he brought me the PC. As I said earlier, there was 2 PCs; 2 brothers. One PC was a simple format/reload. The 2nd one (the PC with the JPG issue) "hadn't been used in a while 'cuz it was real slow". That's an exact quote from the brother with the first PC. So, I'm inclined to think the 2nd brother either has a bad memory, or is, indeed, not being totally truthful about the state of these pictures before the PC got to me. This is one of the pitfalls of PC repair: the lying customer. We always get these PCs that we de-virus, they get 'em home and everything is great for a month or two, they get it re-infected and then they call up and they say "it was like that the first time I turned it on and I was too busy to call you guys". So, they try to tell me that it was just as screwed up right when they got it home and they were too busy for 2 months to even pick up a phone and call us to tell us this. Yeah, right. But most customers don't realize that I can go in and retrieve a VERY detailed history of what's happened on the PC since it left the shop (I always clean all system histories before the customer picks it up. That way I know what's happened between it leaving the store, and it arrival back at the store, if it comes back). I have had to present the customer with this history on several occasions: I've seen faces go dead white and bright red. I've had people say "that's BS. You must have typed that up yourself. I never went on line at all. How do I know that's from my computer?". When that happens I usually (very nicely) ask the customer to take their business elsewhere as I don't particularly like being called a liar and a forger of PC histories. Like I don't have better things to do with my time than to sit down and type up fake very detailed history files that are 10+ pages in length and then print them out. (Yes- I have been accused of creating fake PC histories. I have been accused of sending viruses to people so I could "make money when I charge to clean the computer". Yup- it's true. People suck.)

Anyway- the more I look at these pics, the more I realize that this header repair is going to be very time consuming, and at this point I'll have to talk to him and see if he want to pay for it. There's about 150 pictures with corrupt headers; and over 1000 pictures that are fine. Repairing headers manually on 150 pictures is going to take a LONG time.

Last edited by dlb; 09-21-08 at 14:14..
Reply With Quote
  #7  
Old 09-22-08, 17:29
dlb's Avatar
dlb dlb is offline
Major Geek
 
Join Date: Sep 2007
Posts: 8,568
Thanks: 422
Thanked 868 Times in 738 Posts
Default Re: corrupt jpg headers

I found some very encouraging information at this link but the saving of the pictures relies upon the location of a header "divider" which is signified with the bytes FF DA. The corrupt pics are corrupt to the point where this divider byte is gone. Of the healthy pictures, most are Sony camera pictures, but some have been run through Adobe Photoshop so the header was changed. I'm just about ready to say "too bad... if these pics were that important they should have been backed up". We never guarantee data. EVER. We do our best to save all data, but s*** happens, especially when malware is involved. Unless someone comes along with a miracle fix, I think I'm going to call it a done deal.
Reply With Quote
  #8  
Old 09-22-08, 20:49
Cat_w_9_lives's Avatar
Cat_w_9_lives Cat_w_9_lives is offline
Major KittyCat
 
Join Date: Dec 2006
Location: Chicago
Posts: 1,854
Thanks: 19
Thanked 111 Times in 109 Posts
Default Re: corrupt jpg headers

Think fixable depending on the corruption but labor intensive. I'm sure the Photoshop is fixable too but 150 pics! Don't know how you would go about automating the fix or even if doable with free software. Most likely there is some photo repair software that can do this but would be expensive.

Found this for Jpeg, see if you can find the start
0xFFD8 means SOI(Start of image), 0xFFD9 means EOI(End of image).

http://en.wikipedia.org/wiki/JPEG
(I got to Quantization and my eyes glazed over and went to get a beer, sorry)

My solution would be if doable repair one jpeg, figure out the time. If he wants more charge for them. Look at the bright side, if we ever corrupt one of our photos we're in good shape to go about fixing it *grins* interesting reading.

Also TimW posted this long ago and has a trial http://www.hketech.com/JPEG-recovery/index.php might want to give it a shot and see if it works, watermark in trial but would give you an idea on how corrupt pics are?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
USB/Firewire/Audio Headers PhydeauxHaxor Hardware 1 01-26-07 19:46
More usb 2.0 headers!!!! thesunscreen Hardware 7 12-29-05 18:41
e-mail headers mcpp66 Hardware 1 04-17-05 19:47
Headers..ZoneAlarm unclematty Software 4 12-04-03 07:30


All times are GMT -5. The time now is 07:13.

MajorGeeks.Com Menu

MajorGeeks.Com \ All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ NEW! PC Games \ System Tools \ Macintosh \ Demonews.Com \ Top Downloads

MajorGeeks.Com \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds


All content Copyright MajorGeeks.com source code Powered by vBulletin® Version 3.8.4
Copyright © 2009 vBulletin Solutions, Inc. All rights reserved.
Ad Management by RedTyger