I'm a creative director at Laughing Samurai. I bark orders. Sometimes people listen. Sometimes they don't. When they play nice, I pay with pizza. And sometimes with Nachos. Hell, sometimes even Beer. Wanna work with me? Let's do this.

How to deal with the“unexpected end of file” error in Photoshop

At one point or another, we have all encountered this dreaded and nauseating error that Photoshop can lay on us at the last half hour of a sixteen hour work day (wait… don’t you work sixteen hour days?). The problem is that there is no real easy or reliable way to fix this error. There are some solutions out there like the PSD Extract/Repair plugin which lets you open your Photoshop file one layer at a time. This is extremely cumbersome and not always reliable, since with the corruption of the file also comes corrupted layers.

The best tool against this error is prevention. The following are a few points that can help you prevent corrupted photoshop files:

Work on a local Hard Drive: The main cause of the “Unexpected end of file” error is the fact that Photoshop fails to save the header and footer information of the file, sometimes due to loss of connection. This can occur if you are working on a network server and lose connection, or if the connection between your computer and the hard drive was severed halfway thru the saving process, either by restarting your computer or by disconnecting the drive. Save all your files on your machine’s local drive, and then copy it to your server or hard drive once completed.

Save several versions: When you make changes to files, version your files, and save several versions. This can not only help you keep track of changes between versions, but also let you go back to a non-corrupted version of the file.

Don’t put all your eggs in one basket: If you are working on a multi-page document (like a website), or if you have a file with different versions (languages, colors, etc), don’t save them all in one file. Cluster the versions in some way, or keep them all separate. It is better to have 20 PSD files, than to lose 20 versions of a job in one swoop.

Always save a flat preview file: This may seem as an obvious thing, especially if you are sending a proof, but some people forget to do this. This can at least help you in re-creating the file if it gets corrupted.

Run daily backups: Although sometimes this doesn’t help because you save the corrupted version along with the backup, but if you use something like Time Machine, you might be able to go back in time and recover an earlier version of the file.

Give yourself some wiggle room: Never let your hard drive get too full. Do you really need that file from 2005? Backup to removable storage and never let your hard drive get at 85 to 90% capacity. Remember Photoshop uses drive space as scratch memory, plus the space needed to save your file.

Keep all these things in mind when working on your next Photoshop project, and you just might keep your sanity.

12 Comments

  1. Posted February 15, 2011 at 11:25 am | Permalink George K.

    Its been my experience that if its a flattened file such as a .tif/.png/.jpg and Photoshop is telling you that its an unexpected end of file you can sometimes open it up in Illustrator and re-save it. It is not a guaranteed thing but it has worked in the past. As far as layered .psd/.psb though I haven’t had the same success with this.

  2. Posted April 30, 2012 at 1:00 am | Permalink Jordan

    Easy, just do “save as” saving to make a copy of it! I JUST had this happen to me, and thats how I came here. So just “save as” save, and you should be fine!

  3. Posted April 30, 2012 at 8:28 am | Permalink The Fontografist

    Correct. Saving the file will prevent this. The post was written for people who are trying to open a previously saved file, and get the “End-Of-File” error message.

  4. Posted September 25, 2012 at 12:10 pm | Permalink Leonardo

    I used the application but did not work. It showed me just noise and stripes. The same happened to the online version.

  5. Posted March 20, 2013 at 9:57 am | Permalink Scott

    This happened to me and nothing seemed to work. Finally I opened the image in preview (somehow this was possible) then tried to re-save the image by clicking “save-as.” In the save as window I changed the image from 16-bit to 8-bit and then miraculously it opened in photoshop! Hope this helps someone out there!

  6. Posted July 2, 2013 at 3:39 am | Permalink admin

    isn’t “prevention” advice a bit useless AFTER the fact? Shouldn’t your article actually be called “ways to avoid error message X”?! Just saying…

  7. Posted July 2, 2013 at 7:17 am | Permalink The Fontografist

    The article is meant to stop you from going to Google and wasting hours looking for a solution, considering there isn’t one, and get you back to re-working the file, with some preventive measures. Also, note that the article is titled “How to deal with…” not “How to FIX….”

  8. Posted August 1, 2013 at 5:58 am | Permalink K K

    Try opening the file in illustrator, export as PSD with a different name.
    Open in photoshop.. Enjoy…

    Worked for us..!!

  9. Posted August 20, 2013 at 9:40 am | Permalink Christian

    I opened my file in Artrage which can also read Photoshop files.. and that worked. I was able to export it as a new Photoshop file and then I was able to open it in Photoshop again.

  10. Posted November 16, 2013 at 5:12 pm | Permalink thndr

    As others have stated already, there is an easy fix for this problem since I have just encountered it myself with a .jpg file, I thought I would share. You get the said error trying to open it in Photoshop. So instead, open the same image with MS Paint and save the image as a .png file. Then try opening the ping file in Photoshop instead. This should work for you. Its small and will preserve transparency if it applies to your image.

  11. Posted February 27, 2014 at 8:27 am | Permalink Mark

    Have to chime in here cause I just had this happen to me. Here is a fix to try. Open the psd file in Illustrator check the “make layers into objects” option, if it opens this is a good sign. Now go ahead and export the file as a psd file. This just saved my file after all other things failed. Only thing I have lost seems is my vector masks but Ill take it.

  12. Posted May 20, 2014 at 10:59 am | Permalink CC Bailey

    @Mark

    Thanks, that worked perfectly. Saved 10 hours of work.

Post a Comment

Your email is never shared. Required fields are marked *

*
*