Is it possible to detect photoshop incompatible files?

Started by mbo, October 16, 2019, 07:40:48 AM

Previous topic - Next topic

mbo

Dear community,

i have a tricky problem with some images. They are not compatible to photoshop. That will shown as error message while open files into photoshop.
QuoteThe operation could not be performed because this file is not compatible with the version of Photoshop.

My question: Is it possible to detect those kind of files using exiftool? My claim is not to fix that file. Finding that case would be enough for me.

Some tests from me:
Checking Photoshop Metadata
exiftool -Photoshop:all test1.tif test2.tif
similarities: has layers
disparities: Different Photoshop Versions (CS4 & CS6)
my interpretation: Metadata looks good. No value seems to be accountable for the problem.

Checking XMP Metadata:
exiftool -xmp:all test1.tif test2.tif
disparities: The "History" Values. Files were created on different operating systems. test2.tif was a "image/epsf".
my interpretation: Despite the differences both file have the same problem in photoshop. Also here it seems no value be accountable for the problem.

Some Software informations:
Mac OS X Mojave
Adobe Photoshop CC 2019 (v20.0.6)

testfiles: https://bit.ly/35GZbmD

Phil Harvey

Photoshop can be VERY picky about the metadata in a file.  One version of Photoshop would refuse to open a file if any XMP date had time zone +00:00.

How did you create these files?  Even if I try to open the one that has the Software tag set to "Adobe Photoshop CS4 Macintosh" using this exact version of Photoshop, I get an error.

I could perhaps figure out the exact problem but it would take a lot of time because I would have to manually edit the metadata, one piece at a time, until I figured out what was causing the problem.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mbo

Hey Phil,

thanks for your quick response!

I got this data sent to me. I does not know how they came about.

regards, Marvin

Phil Harvey

Hi Marvin,

Taking a closer look at these files and comparing them to a file produced by my version of Photoshop CS4 Macintosh, I see that the Photoshop metadata in these files is stored in big-endian byte order, which is a big difference from the file I created.  I don't know how that could happen because I would be surprised if CS4 ran on a big-endian Mac system.  My first guess is that this could be the reason for the problem.  But unfortunately ExifTool doesn't report the endianness of the Photoshop metadata.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mbo

Hey Phil,

that might be the cause. I expect some more of these data in the coming days and would like to verify them. How can I view the "byteorder" of the Photoshop metadata?

regards, Marvin

Phil Harvey

For an image with layers, use the -v3 option and look at the raw value the LayerCount tag.  If the first byte is zero then the byte order is big-endian.

Alternatively, you could search the ImageSourceData for the "8BIM" record.  If it exists and "MIB8" doesn't, then it is big-endian:

> exiftool test1.tif -imagesourcedata -b | grep 8BIM
Binary file (standard input) matches
> exiftool test1.tif -imagesourcedata -b | grep MIB8
[no output]


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mbo

To understand it correctly,

if the creator software is Photoshop on mac in version X.X and the byteorder of the photoshop metadata is "big-endian", it could be the problem case we are discuss?
Does this also mean that an image created on Windows with the byteorder "little-endian" is just as corrupt?

I will collect more files in the next days an deposit them for download.

regards, Marvin

Phil Harvey

Hi Marvin,

Windows machines have always been little-endian.  Macs have only been little-endian since 2006.

So I would expect that any version of Photoshop more recent than about 2006 should produce only little-endian Photoshop metadata.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mbo

Here are some more testfiles: https://bit.ly/2IYMqdL

Unfortunately, I cannot derive a clear pattern from this when I look at the creator and the byte orders. Maybe the problem is a little different.

regards, Marvin

Phil Harvey

#9
Hi Marvin,

All of the new test files are big-endian, except for one in which the photoshop resources (ImageSourceData) is corrupted.  Here is the output of a test version of ExifTool that I hacked up:

> exiftool tmp/exiftool-Forum -photoshopbyteorder -warning -a
======== tmp/exiftool-Forum/1000000000015095_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
Warning                         : Bad IPTC data tag (marker 0x0)
======== tmp/exiftool-Forum/1000000000016300_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000019863_00.tif
Photoshop Byte Order            : Little-endian (Intel, II)
Warning                         : Bad IPTC data tag (marker 0x0)
Warning                         : Truncated photoshop resource
======== tmp/exiftool-Forum/1000000000019899_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000020078_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000020098_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000020348_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000020949_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000020950_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000020951_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000020956_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000021303_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
======== tmp/exiftool-Forum/1000000000021304_00.tif
Photoshop Byte Order            : Big-endian (Motorola, MM)
    1 directories scanned
   13 image files read


- Phil

Edit:  Well, it isn't simply the byte ordering that is the problem because I have found a sample TIFF with Big-endian byte ordering that opens OK in CS4.  Googling for this, it appears that people get this message if the Photoshop document data is corrupted in any way.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).