xscan v1.4
Posted: Thu May 17, 2007 6:45 am
I have a generalized solution for detecting partially corrupted and completely corrupted images in a totally automated fashion with Photoshop.
This script is an extension of the original xscan script. It adds the ability to handle partially corrupted images (with help) as well as the ability to copy or move corrupted images to a designated "Bad Images" folder.
First, some background:
When Photoshop detects a completely corrupted image, it throws an exception that can be caught with a script or dealt with transparently by the Batch manager.
When Photoshop detects a partially corrupted image, however, it always prompts the user with the "This document may be damaged..." confirmation dialog. There is no way to avoid this and no way to detect this problem ahead of time.
Until now.
I wrote the script xscan that is useful for detecting completely corrupted images. You can run it against thousands of suspect images and get a list of what images are completely corrupted. By itself, it does not deal with partially corrupted images.
To extend support to detect these troublesome images automatically, I found it necessary to use a WinXP keyboard macro tool. The tool I selected is AutoHotKey at http://www.autohotkey.com. The attached zip file contains an AHK script and ini file that I modified to solve this problem. It should be possible to use a similar macro tool on OSX to achieve the same effect.
To use xscan to detect both kinds of corrupted files, you need to copy the xscan.ahk and xscan-ahk.ini file to your "My Documents" folder. If you need to change names or put them somewhere else, you'll need to edit the AHK script accordingly.
Once the files are in place, run the xscan.ahk script with AutoHotKey. While running, the script looks for the "This document may be damaged..." dialog from Photoshop and automatically hits 'Cancel'.
Now that the AHK script is running, you can start the xscan.jsx script. As it runs and comes across damaged image files, if Photoshop displays the "This document may be damaged..." dialog, the AHK script deals with the dialog causing an exception to get thrown which the JSX script then handles.
At the end of processing, all damage image files are displayed in a final dialog and listed in a log file. The damaged files may also have been copied or moved to a Bad Images folder.
-X
This script is an extension of the original xscan script. It adds the ability to handle partially corrupted images (with help) as well as the ability to copy or move corrupted images to a designated "Bad Images" folder.
First, some background:
When Photoshop detects a completely corrupted image, it throws an exception that can be caught with a script or dealt with transparently by the Batch manager.
When Photoshop detects a partially corrupted image, however, it always prompts the user with the "This document may be damaged..." confirmation dialog. There is no way to avoid this and no way to detect this problem ahead of time.
Until now.
I wrote the script xscan that is useful for detecting completely corrupted images. You can run it against thousands of suspect images and get a list of what images are completely corrupted. By itself, it does not deal with partially corrupted images.
To extend support to detect these troublesome images automatically, I found it necessary to use a WinXP keyboard macro tool. The tool I selected is AutoHotKey at http://www.autohotkey.com. The attached zip file contains an AHK script and ini file that I modified to solve this problem. It should be possible to use a similar macro tool on OSX to achieve the same effect.
To use xscan to detect both kinds of corrupted files, you need to copy the xscan.ahk and xscan-ahk.ini file to your "My Documents" folder. If you need to change names or put them somewhere else, you'll need to edit the AHK script accordingly.
Once the files are in place, run the xscan.ahk script with AutoHotKey. While running, the script looks for the "This document may be damaged..." dialog from Photoshop and automatically hits 'Cancel'.
Now that the AHK script is running, you can start the xscan.jsx script. As it runs and comes across damaged image files, if Photoshop displays the "This document may be damaged..." dialog, the AHK script deals with the dialog causing an exception to get thrown which the JSX script then handles.
At the end of processing, all damage image files are displayed in a final dialog and listed in a log file. The damaged files may also have been copied or moved to a Bad Images folder.
-X