Wondering if anyone can suggest a way to identify layered TIFs placed in an InDesign doc. It is nothing that Preflight will flag. Quite certain Flightcheck won't either.
I'm hoping this doesn't turn into a "what's better: PSD or TIF" conversation.
I​'m wondering if what may be better than identifying the layered tif files may be simply running a script that finds all tif files and automatically flattens them. I'm not a Photoshop guy but I'm pretty sure it can be done. In Corel we would simply run what's called a macro. I'm assuming that ID would still find them and link them as long as the name was not changed.
This won't flatten any TIFFs, but it should quickly separate the flat ones from the layered ones.
If you're using a Mac, copy and paste the following into a blank TextEdit document that is "plain text" not "rich text" (changeable in the Format menu). Save it with a filename ending in ".command" so Finder will execute it with Terminal.app. You'll probably have to do a "chmod +x" on the file in Terminal to make it executable, unless you save it to a mounted network volume and move it back to your computer (that often causes the executable permission to be set).
Place the file in a directory containing TIFF files to be checked, then double-click or CMD-down to run it. It should scan each file in that directory (but not subdirectories - that behavior can be changed if desired).
If a file is a TIFF file containing Photoshop's layer tag, it will move it into a subdirectory named "MULTIPLE LAYERS," which it will create. It will scan all regular files, which should happen fairly quickly, but you can speed it up a bit by setting TIFFEXTENSIONONLY=1, which will only scan files ending in .tiff or .tiff (case insensitive). The only TIFF files it should not move are ones that Photoshop will show as having a single "BACKGROUND" layer.
If there is a single non-background layer that happens to be completely opaque, which is effectively flat, it should still move it. If you consider that a false positive, you'd have to open the file and "flatten" it to make it behave as intended.
here it is:
#!/bin/bash
TIFFEXTENSIONONLY=0
cd "$(dirname "${BASH_SOURCE[0]}")"
SAVEIFS=$IFS
IFS=$(/bin/echo -n $'\n\b')
if [[ TIFFEXTENSIONONLY -eq 0 ]]; then
for N in $(find . -maxdepth 1 -type f ! -name '._*'); do
if [[ $(head -c 2 "$N") == II ]] || [[ $(head -c 2 "$N") == MM ]]; then
tiffutil -dump "$N" | grep '^37724 (0x935c)' > /dev/null
if [[ $? -eq 0 ]]; then
mkdir -p 'MULTIPLE LAYERS'
mv -n "$N" 'MULTIPLE LAYERS'
fi
fi
done
else
for N in $(find -E . -maxdepth 1 -iregex '.*tif(f){0,1}' ! -name '._*'); do
if [[ $(head -c 2 "$N") == II ]] || [[ $(head -c 2 "$N") == MM ]]; then
tiffutil -dump "$N" | grep '^37724 (0x935c)' > /dev/null
if [[ $? -eq 0 ]]; then
mkdir -p 'MULTIPLE LAYERS'
mv -n "$N" 'MULTIPLE LAYERS'
fi
fi
done
fi
IFS=$SAVEIFS
echo TIFF layer checking finished $(date)
Kyle, that shell script is a thing of beauty, way to go!
Just curious – is this leveraging a core Mac OS X feature, could AppleScript also do the same? Would this work in another Unix OS or under Cygwin in Windows?
Stephen Marsh
Thanks! If I had to do this with Applescript, I'd probably just wrap most of the bash version with "do shell script."
A 30-day Fix for Managed Chaos
As any print professional knows, printing can be managed chaos. Software that solves multiple problems and provides measurable and monetizable value has a direct impact on the bottom-line. “We reduced order entry costs by about 40%.” Significant savings in a shop that turns about 500 jobs a month. Learn how……. |