Atomik Roundtrip 2.1: Working with Roundtrip << >>

Chapter 15 Working with Images

Atomik Roundtrip is able to import images that are referenced in your XML file into your QuarkXPress document. Atomik Roundtrip reads the image reference specified in the XML file, and instructs QuarkXPress to import the file into whatever type of box was specified in the ruleset. You should note that if the appropriate image import filter XTension is not loaded, or if QuarkXPress cannot locate the image file at the location specified in the XML file, then the image will not be imported.

The path which is specified for the image must be accessible to the computer on which the XML is being imported, and is considered relative to the location of the XML file. This is particularly important, as different operating systems specify their paths differently; a Windows path will start with either a drive letter or computer address (c:\ or \\12.34.56.78\share_name\), whereas a Macintosh volume will always be referred to by its volume name (Macintosh HD, for example). Whilst Roundtrip is able to read Windows, Macintosh and UNIX path names, it cannot convert between different systems of specifying the host computer or drive : for example, it can’t turn “f:\Documents\my_xml.xml”or “/mnt/fileserver/Documents/my_xml.xml” into “File Server:Documents:my_xml.xml”. If you wish to use Atomik Roundtrip in a cross platform environment, you must use relative paths for images. Roundtrip will consider any path which doesn’t contain a volume name or drive letter, and doesn’t start with a path delimiter (/, :, or \), to be expressed relative to the XML file which you are importing. So, if your XML file is in a folder on the server, and your images are located in a sub-folder of that folder named “Images”, your XML would look something like this:

<Image imgPath=”Images:picture123.tif”/>

However, it could equally well look like either of these, as Atomik Roundtrip is able to deal with any common path delimiter:

<Image imgPath=”Images/picture123.tif”/> <Image imgPath=”Images\picture123.tif”/>

The naming of the attribute is unimportant, as you can specify the name of the attribute that contains the image path in the ruleset.

If you are using Roundtrip on Windows or the Classic environment of MacOS X, you can also specify a parent folder, or a folder which is on the same level as that which contains the XML by using a special notation. This notation will not work under MacOS 9 - only the Classic environment of MacOS X.

<Image imgPath=”..\Images\file.tif”/> (Windows) <Image imgPath=”../Images/file.tif”/> (MacOS X Classic environment)

This instructs Import to step one level up the folder hierarchy to that in which the XML was stored, and look for a folder called images. This would be suitable if your file system contained, for example, a folder for each project, inside which were two further folders containing XML and images respectively.

  1. If the relative path to the images is not correct in the XML, there is still a way to import the images successfully. Import will first look for the image using the path specified in the XML file. If Roundtrip cannot find the file, it will extract the filename from the path specified in the XML, and look for a file with that name in the same folder that the XML is stored in. If this fails, Roundtrip will look into the folder specified in your Roundtrip preferences as the ‘Default Image Location’. If it still cannot find a file with the correct name in this location, you will be presented with the following dialog box:

If you select ‘Skip’ then the picture box will be filled with a default image. However, QuarkXPress will remember the correct image file name (you can check this by looking at Usage on the Utilities menu in QuarkXPress) - so that if the image is put back where it’s supposed to be, then QuarkXPress will pick it up when you send the job to print.

Alternatively, if you know that the image has been placed in the correct location, you can tell Atomik Roundtrip to go and look for all the images for which it has inserted placeholders by clicking the ‘Update Images’ button (

) in the Import XML palette. This will make Import go through the document and replace every image file for which it can find the correct replacement file.

If you click ‘Skip All’ - this will do the same as clicking ‘Skip’, but instead of asking you about every image, it will automatically skip all the missing images and replace them with the default ‘Image Missing’ picture.

As previously described, you can select various options for the box to import the image into. If you select “Use Existing Box” the image must be dragged to a picture box (or referenced from a placeholder placed into a picture box).This doesn’t allow the image to be mapped as a child element.

If “Create Anchored Box” or “Create Floating Box” are selected, the image can be mapped as a child element. Selecting “Create Anchored Box” will create a picture box anchored in the text flow of the text box into which its parent and sibling elements are placed. The specifications of this box can be pre-specified in the ruleset window by clicking on the “Modify” button, which will allow you to select all the attributes for this anchored box which you would normally be able to specify if you selected “Modify” from the “Item” menu in QuarkXPress.

Similarly, if you select “Create Floating Box”, a new box will be created which is not anchored in the text. You will note that clicking on the “Modify” button with this option selected also allows you to specify the x,y co-ordinates for where this box will appear on the page. You should note that all floating boxes created in this way on a particular page will be created at the x,y co-ordinates specified : which will inevitably lead to the images overlapping if more than one image is imported onto the page.

You can also specify several fit options, to allow you to fit the image to the picture box, or to fit the box to the image. If you select to fit the box to the image, this will override the settings for box width and height and image scaling which you have specified by clicking the ‘Modify’ button.

Unparsed Entities

It’s fairly common for XML which has been devised for a web site to contain images as ‘unparsed entities’, rather than as an image reference. An unparsed entity is a special string of characters which represent an image (or, indeed, any other type of file), so that when the XML containing this unparsed entity is interpreted, the unparsed entity is replaced by image data. This works well in some contexts where it would be appropriate for all of the data to be contained within the XML file.

QuarkXPress is, however, a different matter. Whilst it might be appropriate to include a 20KB JPEG file as part of the XML text by using an unparsed entity, it would make the XML particularly ungainly if you tried to do this with a 30MB EPS file (and files of this size are not uncommon in publishing applications). Also, QuarkXPress does not store the whole picture within the document, rather it stores a low resolution preview and a link to the file on disk. If QuarkXPress needs a path to the image and if the image is stored as an unparsed entity in the XML rather than as a path to the image, then QuarkXPress won’t be able to import it (and even if it could, it certainly wouldn’t be able to print separations from it).

Of course, if you are using the same XML for multiple purposes, you would normally need to provide multiple different images for each picture, as web and print graphics will usually be in different formats and resolutions, and it’s only the print graphics which absolutely need to be expressed as a path to the image. Any other graphics not intended for print can be expressed as unparsed entities; you just need to specify in the ruleset that these files won’t get imported by Roundtrip (by unchecking the ‘Can be Dragged’ and ‘Can be Mapped as Child’ checkboxes in the Ruleset palette for those elements).