(v13) OPI file searching - fuzzy name matching
This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP.
The default OPItranslator
procedure in the OPI code uses a simple form of fuzzy name matching to find the high-resolution data file for a particular set of OPI comments. This allows the preview file to have a different name to the high-resolution data, For example: Image.FPO
might be replaced by Image.PDF
. See (v13) Customizing the OPI procset for notes on replacing the file search mechanism.
Use this method to select which file should be used:
- If the OPI comments included
%ALDImageID
: or the OPI dictionary in a PDF file included anID
key, this name is taken as a starting point. - The drive and directory path are stripped from the name, by searching for the last instance of colon, slash, backslash, or percent characters (
: / \
or%
) and assuming that the instance found is the end of the path. - An extension of eight characters or less, starting with the last period (.) in the file name (if present) is searched for.
- All files in the first nominated search directory and its subdirectories are searched for files that match the filename, the filename plus an extension, the filename without an extension, or the filename with its extension replaced by another one. If
OPIfileSearch
is/Insensitive
, all file names are converted to uppercase before comparisons. - Any files where the final extension matches one of the entries in
OPIlowResFiles
are removed from the list found. - If a single file matching these criteria is found, that file is selected. Go to END (of this set of numbered steps).
- If one of the files found exactly matches the name of the low-resolution file and
OPIfavorMatch
istrue
, select that file.
Go to END.
- If exactly two files matching the criteria are found,
OPIfavorMatch
isfalse
, and one of them matches the original filename exactly, it is assumed that the file whose name matches is the low-resolution file, and that the other is the high-resolution file; the file whose name does not match is selected.
Go to END.
- More than one file has been found that does not match the original low-resolution file name. Next, check whether all such files are part of a single file set (that is, whether they comprise a DCS1 or DCS2 set).
- If all the files are EPS (including PC format EPS) and a single DCS main file is included, the FP or DCS main file is selected.
Go to END.
- Multiple files match the selection criteria, and no clear way determines which one is the correct one to choose. If one file matches the original file name exactly, select it.
Go to END.
- If the value of
MultipleMatches
is/Abort
, stop the job with anundefinedresult
error. Go to END. - Select a file at random from the list of files matching the criteria. If the value of
MultipleMatches
is/Warn
, issue a warning in the System Monitor and log file.
Go to END.
- If no file is found, repeat steps 4 to 13 for the second nominated search directory, then the third directory, and so on.
- If no file was found scanning against
%ALDImageID:
orID
, repeat steps 2 through 14 using the value of the%AldImageFileName:
comment from a PostScript file, or theF
key from a PDF file. - If no file is found, report that and act on the value of the
OPIerrorAction
key. END (of this set of numbered steps).
The RIP can do case insensitive matches, if OPIfileSearch
is set to /Insensitive
.