The problem, the missing modification date
The demands InDesign has for images, has always been:
1) Access to the binary data, to be able to display the image.
2) Having information about modification date.
And a basic URL does not contain both these information, a file path does.
When does InDesign need the full data of your images?
InDesign basically needs access to the full image all the time, to generate a nice preview, when displaying the images in high res, when exporting and printing, and if you save the document with page preview, it need access again.. so all the time
We have come up with a solution
The solution is to use a Pre-Script to:
a) Read the url from data
b) Fetch the image/images from a url
c) Download and save the image/images in a local folder
d) Change the field of the image/images to filename
Any catch? , Yes!
The solution will use your internet connection to fetch the image first time, and we still haven’t got a modification date, so the cache folder will only be updated if you manually delete an image..
Is the quality good enough?
A JPG file 30x40cm (12×16 inch) 240 dpi, saved in Quality 10 in the Photoshop, will take less than 2 MB. And many images on the web has grown in size, so the web user is able to zoom into the product image to see any detail.
Will this be too slow?
Most of the images used on the web, and we think that the images used in this solution, will mostly be imaged in the svg, jpg or png format, compact and small files.
So if you have a fairly good internet connection, and your webserver has the same, the speed is properly just a minor issue the first time, the files are downloaded. In the development process, we did a test run 78 images, the smallest image was 106KB, the largest was 1.7 MB.. it took 1 minute and 9 seconds.. and all the images were big enough to be used for a print catalogue. This demo setup, with all images in 4K solution (3840 pixels wide, or good enough for printing in A3), takes 6 seconds..
How to use the script?
First, you need to download the script (“DOWNLOAD PACKAGE“) to your computer, then go to the project settings, and point to the script, at the “Pre-Script File” part of your setting.
Then set a parenthesis after the script name with all the image merge field you want the script to handle like this..
.. /Myscripts/PrescriptFetchImageFromURL.jsx (IMAGE)
or if you have more than one image.. ../myscripts/PrescriptFetchImageFromURL.jsx(IMAGE,IMAGE_TWO,IMAGE_THREE)
The important part is to use the right merge names in the parentheses, otherwise we are not able to manipulate/cache the files.
Second, you will need to point to the cache folder, at the “Image Path”. The Cache is set up in the script to be:
And that’s the normal place for a standard installation of the Cacidi Extreme/LiveMerge. If you want to change the location, maybe share the cache folder with your colleges you can do that, be changing to first line of the script.
Location of cache folder
Contents of cache folder after first run
And lastly, you will need to use the “13-Fruits-UTF8_URLS.tsv” included in the download package.