Skip navigation
Currently Being Moderated

What causes 'Unexpected end-of-file' error?

Sep 24, 2009 1:07 AM

Hi,

I am a photographer and an avid Lightroom user. I have two camera's (Nikon D700 and D300) and two computers, a desktop PC and a MacbookPro. Lightroom is installed on both computers.

 

For the last three photoshoots I have had this problem where 1 in 3 to 1 in 5 images in Lightroom on my desktop PC suddenly gives a 'Unexpected end-of-file' error. First I thought it was my camera. But then I loaded the images onto my MacbookPro and they worked fine. Then I took some images with my other camera, loaded them on to my Desktop PC, and, voila, same problem.

 

The problem specified: the image stops rendering a preview. A dull preview appears. At the top of the screen the message appears: "An unexpected end-of-file occurred." The histogram window stays empty and the image can not be developed.

 

I have browsed through this forum some looking for the cause and the fix. There are some mentions of it, but they all date back to 2007.

 

I run LR 2.2 on Windows XP SP2 and on a MacbookPro with OS X, version 10.5.8.

 

Please help me understand the cause of this problem, and help me find a fix?

 

Thanks,

 

Rogier

Rotterdam, The Netherlands

www.rogierbos.com

 
Replies
  • Currently Being Moderated
    Sep 24, 2009 8:34 AM   in reply to RogierBos

    I'd try deleting the Previews folder on the PC, with LR closed, then choosing the recent folders and force-build new Previews to see if that cures it.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 24, 2009 4:03 PM   in reply to RogierBos

    The Previews folder is in the same directory as the .lrcat.

    Yes, it will delete all the Previews, but they will all be rebuilt anew. It might be instructive to note the size of the Previews folder before you delete it, and then after it has had a chance to rebuild the preview images.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 25, 2009 7:58 AM   in reply to RogierBos

    Today is the first time I have also found this error. I was working in Hong Kong and using Lightroom on a PC. At the end of the assignment I transferred all the files to a bunch of USB memory sticks and then transferred the contents to my Mac when back home. The files that throw up this error are all from one particular memory stick (brand new/never used). They are also NEF files. Looking around on the net I see people also having problems with NEF files and CF cards or readers resulting in the "unexpected end-of-file" error.

     

    The files had been fine on the PC in HK so the errors were something that had crept in during the transfer to the USB stick.

     

    The memory stick is a corporate branded unit made by Chipsbrand HK and was a freebie so I hadn't used it before. I use Sandisk CF cards and they have never been a problem. Have you tried using different cards and seeing if one or other is more prone to giving this error? Have you formatted your cards recently?

     

    Anyway, just now I ran Disk Utility on the suspect USB stick and sure enough it shows files with errors and orphaned clusters. The other sticks are clear of errors and consequently there are no problems in Lightroom. Phew! So I suggest you check your memory cards for errors and repair or reformat them. It shows it is probably worth reformatting storage cards/sticks before use to be sure of them. I do routinely format the CF cards whenever I empty them so start afresh with each shoot. This was a practise recommended in Nikon forums and has been good advice I think. I was in a hurry and didn't format the memory stick on this occasion. Fortunately the level of errors is maybe 1:25 so I haven't lost too much. I reformatted the stick a few minutes ago, transferred some files to it and re-tested and it is now error free.

     

    Hope this helps in your search for a solution to your particular errors. I fear the images, at least in RAW format, are probably lost. Some people say that opening in a non-Adobe programme as a TIFF does at least save the basic image but obviously with no further RAW processing available. Haven't tested this myself yet.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 10, 2010 5:03 PM   in reply to 2bike

    I am having the same problem on my Mac Pro as well as my Macbook Pro, so it's not just a PC problem.

    It didn't happen with my D300 .NEF files, but is happening with my Leica D-Lux 4, seemingly randomly, with both raw and jpeg.

     

    Any help appreciated.

    Thanks

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2009 9:00 AM   in reply to sfslim

    I noticed the problem after transferring the files from a work PC to my Mac via USB memory sticks. It is, I think, neither a Mac or PC thing, but more to do with errors introduced by defects in the storage media. I was also using a Panasonic LX3 (in many respects identical to your Leica) and none of its files were affected. I mentioned the NEF problems because others were speculating that maybe it was a problem limited to NEFs. Interesting that it is the other way round for you so that shows that it is not just a Nikon thing.

     

    Have you tried formatting the SD cards that you use with the Leica? What make are they/it? Have you looked at the card(s) in Disk Utility to see if it shows errors (select your card when it appears in the Disk Utility window and use Verify Disk)?
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2009 9:03 AM   in reply to RogierBos

     

     

    I run LR 2.2 on Windows XP SP2 and on a MacbookPro with OS X, version 10.5.8.

     

     

     

     

     

    Try upgrading to Lr2.5

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2009 9:43 AM   in reply to Ian Lyons

    It happened to me with version 2.4 and there is no change in 2.5. Lightroom is flagging up an external problem. Photoshop (or rather ACR) has the same trouble with the damaged files.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2009 10:17 AM   in reply to 2bike

    2bike wrote:

     

    It happened to me with version 2.4 and there is no change in 2.5. Lightroom is flagging up an external problem. Photoshop (or rather ACR) has the same trouble with the damaged files.

     

    In the past, the damage shown in the linked files has been tracked to an issue with USB port or device. I don't know if this is the case with your images, but it's worth checking. Trying a different card reader or connecting via FireWire are some of the things I would try.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2009 11:18 AM   in reply to Ian Lyons

    Thanks Ian, and I am pretty certain now that in my case the problem indeed stemmed from one particular USB memory stick. Yesterday I erased its contents and after adding new files to it it appeared OK. Today I checked it in Disk Utility again and it showed problems with a number of the files, once again reporting orphaned clusters etc. I ran the Repair routine on it and it says it has repaired the volume. We'll see - I'll test again tomorrow. If it shows further problems I'll bin it as it just isn't worth the risk to further files.

     

    It would be interesting if someone had the files that were reporting damaged in Lightroom still on their original as-shot card (I'm afraid i don't) and could try different methods of transfer to see if the errors are being introduced by a particular device as you say. If the original memory card and files are OK then the errors may not show up in all methods. However, if the problem is a corruption on the original card then, in theory, all transfer methods would reveal the same errors.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2009 11:33 AM   in reply to 2bike

    I always format my card in the camera whether the Nikon or the Leica. it's a 2GB San Disk.

    This doesn't happen with my CF cards.

    I have run Disk Utility on the SanDisk, Repair Permissions etc.

    Your suggestion that there could be a problem with the reader is a good one. I used one cheap reader with the Mac Pro originally and that may damaged some of the files by the time I tried them in the pc slot reader on my MacBook Pro.

     

    By the way I really appreciate you all getting back to me so quickly.

    I will get another reader and shoot off some uninportant pictures and get back to you. The ones I lost were of our Govenor.

     

    All of this did shut down LR 2.5  (as in I could not open it again, even after rebooting and reinstalling). I'm going to stick with LR 2.4 for a while.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2009 1:55 PM   in reply to sfslim

    Are you using the same card in both cameras (I ask because your post implies that it is one SD card only)? I have heard that it is a bad idea to mix cards and cameras as the formatting is different for each make. Also I believe repeated formatting eventually degrades the card as there are a limited (though quite large) number of formatting cycles that can be performed. Did Disk Utility reveal that there were errors in the files on the card? Maybe get a dedicated SD only reader rather than a multi-card one. I have one that I picked up from an HP trade stand and it has been very good. My last trip that threw up the file errors I had a cheap Integral reader. However the files were uncorrupted on the PC and in my case I'm sure the damage was caused after the initial download when they were transferred to the dodgy USB stick.

     

    The "shut down" of Lightroom sounds serious. So far 2.5 is working fine for me.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 21, 2009 9:54 PM   in reply to RogierBos

    While the corruption in your .NEF file could come from any one of a number of sources, here is a way to recover at least some of the information if you own Adobe Acrobat.  Your .NEF file should contain a smaller JPEG file created by your Nikon camera when the picture was taken.  Even if the .NEF file is corrupt, the JPEG may well be intact, and you can tell that's the case if a preview is visible in Lightroom or Bridge. 

     

    If you try to print it from Bridge or Lightroom, though, you will get an error.  You can get around this by loading up a CODEC that will let you preview the files in Windows Photo Gallery.  Nikon has one available for download to use with Vista x32 at http://www.nikonimglib.com/nefcodec/index.html.en, but it doesn't support Vista x64, so if you're running that (as I am) you'll need a second party CODEC such as the one available from http://www.ardfry.com/Products.htm with a 15-day trial download available.  They also have a DNG CODEC which I have not tried.

     

    With that CODEC installed and your system rebooted, preview the damaged NEF file in Windows Photo Gallery.  Choose the "Print" option and select the "Adobe PDF" printer.  Choose the "Postscript Custom Paper Size" option, and set the dpi resolution to the highest available (4000).

     

    Go to the "Options" link on the bottom right of the window and uncheck the "Sharpen For Printing" box, as you can do this yourself with later processing.  Then go to the "Printer Properties" link to see the Adobe PDF settings.

     

    Go to the Adobe PDF Settings tab and choose Default Settings: High Quality Print, which will set the resolution to 2400 dpi. 

     

    You want to have Acrobat interfere as little as possible with the output, so select "Edit" from the Default Settings tab, which will bring up the "High Quality Print - Adobe PDF Settings" dialog.  Here, turn off the "Optimize for fast web view" check box, then go to the "Images" folder and set the "Downsample" setting to Off and the pixels per inch to 2400.  Also, set "Compression" to Off.

     

    If you're going to do this in the future, you can also "Save As ..." your settings for future use with a name like "Fix Bad NEF Files."

     

    Print the file to a designated folder.  It won't be quite as good as the NEF file would have been, but at least you haven't lost the shot.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 7, 2009 4:03 PM   in reply to rxfelix

    I have had the same problem with LR 2.5 and ACR 5.5 now for several months. I have the problem with NEF files from my Nikon D3 and D700. I was using Lexar Pro UDMA cards and a Lexar firewire 800 reader on my Macbook Pro when it started happening. I have since switched to brand new SanDisk Extreme Pro cards and a SanDisk Firewire 800 card reader, with no change in the problem. It is intermittent. Some cards will will import fine one day, and not the next. The problem seems to be Lightroom Centric, if I import files using Lightroom and they are corrupt I can usually drag and drop the files from the card into a folder and then import them and they are fine. Does anyone actually have a solution to this problem or should I try to find a different software import option?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 8, 2009 12:51 AM   in reply to IanHylands

    Just a thought. Have you, or anyone else on the thread, tried doing a complete reinstall of Lightroom? I have had no problems with importing on my Mac since encountering the issue and wonder if it was the other PC installation that triggered my problems - not because it was a PC, this issue seems to be one that affects both platforms, but maybe there was some glitch in that particular installation. Another thought, which may be a complete red herring - that PC installation was based on the downloaded trial software and my untroubled Mac install is from the purchased disc.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 8, 2009 9:41 AM   in reply to 2bike

    I've switched to a brand new Mac Book pro with the same problems, and my install is from the DVD, not the download. It didn't always happen, but it seems to happen more and more regularly. It's usually not a problem if I transfer the files to the correct folder by another method and then import from LR without moving them. So it seems to be an issue LR has when moving files from one location to another. I just can't figure out why it would be getting worse over time...

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 8, 2009 10:01 AM   in reply to IanHylands

    Have you tried the LR3 beta? What happens if you make duplicates of a folder that has shown problems and then run them into a new LR3 catalogue as a test (given that the beta won't work with existing catalogues)? I know when i got problems with the USB stick i wasn't using Lightroom to do the transfer, just copied the folders direct to the stick. I only noticed the problem when reopening the catalogue and files on my home machine.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 8, 2009 10:13 AM   in reply to 2bike

    I don't really have time to mess around like that. Now I just transfer everything manually from the card to a folder and then import into LR from there. That seems to prevent any problems. I'll be switching to the 2.6 Beta this week when I pick up my D3s so I'll let you know how that works.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2010 8:53 AM   in reply to IanHylands

    I also ran into this problem 'Unexpected end-of-file' error. My Photoshop document took several hours to complete and then it was unable to open. My fix was to go back in time (using time machine, in OS 10.6.2). I selected the file from an earlier backup and voila. It would be nice to find out what is causing the problem in the first place though.

    mg

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2010 9:03 AM   in reply to mwgarrett

    I still haven't heard anything from Adobe on this, and same with a few other people. It seems like they're too busy to deal with this kind of stuff if they don't have a ready answer. Too bad. I haven't had any problems yet with 2.6, but I'm also not using an Adobe product to transfer the files from the card which is where my previous problems seem to have come from.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2010 6:11 PM   in reply to RogierBos

    I've had this happen for the first time just now. I've imported a huge number of images taken yesterday at a sumo tournament, using a

    brand new memory card. I've gone through flagged the ones I want in the Library module, then as I'm going through them in the Develop module, I'm using a preset I made (a white balance adjustment) and one of the flagged files gave me that message. Since others believe they've traced the source of the error to their memory sticks... I'm not sure if the error occurred because of the new memory card, or from the external hard drive I'm using. I'll admit, the external hard drive is about 4 years old, it's summer, it doesnt have any ventilation or cooling of its own, but its a small 20Gb pocket drive. Now I'm getting worried.

     

    Edit: just adding, I'm using LR v2.7

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2010 6:18 PM   in reply to Winjeel

    Did you format the new card in your camera before you shot with it?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2010 6:29 PM   in reply to Jonathon LeFaive

    Nope

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2010 6:43 PM   in reply to Winjeel

    There seem to be several causes, one of them is faulty cards or card errors, the other is a pretty big problem with LR itself that Adobe refuses to comment on. I get file errors, missing preview images etc. fairly regularly on several different machines with different versions of LR. I sometimes have to import a file 3 or 4 times to get it to import properly without problems. It happens to me most frequently when synching or updating folders or when there is only 1 file to import. The file is already on my computer in the folder, nothing wrong with it, yet when LR imports it there are errors. This also happeens to random files on import. I usually then copy them over using Bridge or something to make sure they're alright and then keep trying til LR gets it right. I really wish Adobe would fix or even just acknowledge this issue.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2010 7:13 PM   in reply to IanHylands

    Thanks for the insight. I'll try a few things and see what works.

    Cheers.


     
    |
    Mark as:
  • Currently Being Moderated
    Aug 22, 2010 5:02 PM   in reply to Winjeel

    I believe some of the problems above are related to Edit > Catalog Settings... > Metadata > EXIF > Write date or time changes into proprietary raw files.  If this is selected and you change the capture time on your images then around 1 in 256 photos will become corrupted.  The problem is one in 256 files will end with character 26 (or character 1A in Hex).  When updating the files Lightroom removes the trailing character 26.  First of all turn off this switch.  Secondly if you don't have a good original copy you can download and use HEdit to append the trailing character 26 to your file.

     

    I first posted this problem in September 2007 on the forum.  It is still an issue in the 3.2 RC.  I have reported the bug through adobe labs (correct channel rather than this forum) and they are looking into the problem.

     

    http://forums.adobe.com/message/1399193#1399193

     

     

    If you are having problems with lots of images then obviously the issue is something else.

     

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 1, 2011 3:14 AM   in reply to josephallannz

    We fixed the problem (regarding saving on a server) with one small trick:

    no file preview.

     

    Jochen Uebel

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2013 8:02 AM   in reply to RogierBos

    This is the first time I have received this problem. Not only do I get end-of-file error, most pictures after it get distorted lines. I shoot with a Canon and a UDMA 7 high grade card. I have checked all my memory on the PC, no problems there. I have checked my disk drive and all sectors were good (I have a 2 TB hard drive so this took all night). I have no hard ware problems as some have said. I can open up all my Raw files in other software, just not Lightroom 5. I have even copied all the Raw files to another directory and imported them into lightroom, and I have the same problem. I then started with a new catalog and the problem got worse. I'm lost on how to fix this.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2013 3:24 PM   in reply to awesumtoy

    What other software are you using to open up the Raw files?

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 16, 2013 5:18 PM   in reply to josephallannz

    I was using Lightroom V5. I also tried it in Canon's DPP and Photoshop. All the photos are bad in whatever program I use. I am now thinking it is the CF memory card.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 10, 2013 12:56 AM   in reply to RogierBos

    Hi all

     

    I'm having the same problem with my Nikon D700 NEF-files and Lightroom 4. This is definately a Lightroom issue, and the reason I say this, is based on the following observation:

     

    I have made a Ligthroom-installation on both my stationary iMac and my MacBook Pro 15". Only difference is that I recently upgraded my MBP OS from Snow Leopard to Mountain Lion. A week ago, I transfered hundreds of NEF-files through a USB card reader to the iMac. All files showed perfectly in Lightroom on this machine. I subsequently copied the files from the iMac to  MBP via local network, imported to Lightroom and bingo – end-of-file errors. So this has nothing to do with the CF-cards.

     

    The problem is relatively new to me. I've had a very rugged and stable setup for years, but somewhere along different upgrades, things have turned unstable. I can't help thinking it might be connected to the recent Moutain Lion upgrade. But as I read things posted here, even brand new hardware + new installations are giving headaches.

     

    I think it would be the least Adobe could do, to point out some solutions and address this serious issue, that damages vital image files, and leaves customers in despare.

     

    PLEASE, Adobe  –  speak to us!

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 10, 2013 2:53 AM   in reply to jesse63

    Out of interest - have you tried converting the NEF files to DNG and then transferring them? Do they still get corrupted?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2014 6:44 AM   in reply to RogierBos

    I have most likely solved my problem with the corrupted RAW-files. The most logical explanation in my case is, that in conjunction with an upgrade to Moutain Lion, I also installed an 8 Gb RAM upgrade. This was a well known and recognized brand, sold by a widely trusted vendor. I was advised in another forum to check the RAM with the shareware REMBER, wich instantly diagnosed the RAM as defective.

     

    So looking back, the math seems to be quite simple. The defective RAM have messed up the file handling, both when reading RAW files from flash cards, and when archiving to external hard drives. I haven't encountered problems since I replaced the RAM with new ones, that passed the REMBER test.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points