Image Folder Processing
The Image Editor clears, trims and resizes one picture at a time. Tools › Image Folder Processing does the same for every picture in a folder, in one go.
- Open Tools › Image Folder Processing. The Multiple Image Files Editor opens.
- In Input Folder, type or paste the path of the folder of pictures, or click ... to find it. The number of files in it shows alongside.
- In Output Folder, give the folder the results should go to. An empty folder is best.
- Click Clear White Space or Scale Images Down to Maximum Size, after setting the options beside it.
- When it has finished, a message says how many pictures it found and how many it changed.
To do both to the same pictures, clear the white space first, then scale down the results, with the first run's output folder as the second run's input.
Clearing white space
Clear White Space works along each row of pixels from the left and right edges, and down each column from the top and bottom, making near-white pixels transparent until it meets one that isn't. The white around the pack goes; white inside the pack, such as a white label, stays.
- Tolerance, 5% to start with, is how far from pure white a pixel may be and still be cleared. Raise it for an off-white or pale grey background. Lower it if pale parts of the pack are disappearing.
- Trim, the default, then cuts each picture down to the pack. No Trim keeps the picture's size, with a transparent border.
- Only white is cleared. For a coloured background, use the Image Editor's Clear, which clears the colour you click.
- Watch white packs. White on the pack that touches an edge of the picture, such as a white cap, can be cleared too. Look through the results, and use a lower Tolerance, or the Image Editor, for the ones that suffer.
The message at the end gives the pictures found, the pictures changed and the files with errors: files in the folder that could not be read as pictures. Their paths are copied to the clipboard, so paste them somewhere to see which they were.
Scaling down
Scale Images Down to Maximum Size makes every picture larger than the maximum smaller, keeping its shape. The maximum is a number of pixels, width times height. It starts at the Large Image Pixels figure in Tools › Settings › Miscellaneous, 150,000 unless you have changed it, which is about 390 by 390 pixels for a square picture.
Spanner draws hundreds of pictures at once, and large ones use memory and slow the drawing, in 3D most of all. A picture far bigger than the shelf will ever show it adds nothing but weight.
What is saved
- Each result goes in the output folder under the same name as the original, replacing any file of that name already there.
- Pictures are saved in PNG format, which keeps a cleared background transparent. A file named
.jpgtherefore comes out holding a PNG picture. Spanner and Windows show it normally, but a program that checks file types may not, so keep the originals if anything else uses them. - Pictures that need no change are copied to the output folder as well, so it ends up with the whole set. When the output folder is the input folder, they are left alone.
- Only the files directly in the input folder are done, not those in its subfolders.
To use the results, put them in the folders your image search settings look in, with the names they expect, then reload the document's images. Adding Products and Positions explains how Spanner finds pictures.
Folder File Details
Tools › Folder File Details lists the files in a folder, ready to copy into Excel, without opening File Explorer.
- Open Tools › Folder File Details.
- Type or paste a folder's path in Select Folder, or click ... to find it. The list fills at once, with the number of files at the top right.
- Each file has a row: File + Extension, File Name Only, Extension and Path.
- Click Copy to Clipboard to copy the list, with its headings, to paste into Excel, or Export to Excel to save it as an Excel file.
Only the files directly in the folder are listed, not those in its subfolders.
Matching pictures to products
Spanner finds a product's pictures by their file names, usually the product's ID or barcode. So a list of a picture folder shows which products have pictures, and which pictures belong to no product:
- List the picture folder and copy it to Excel.
- Copy your products' IDs or barcodes from the Product Coding report to the same workbook.
- Look one list up in the other, with
XLOOKUPorMATCH, on File Name Only.
Two things can stop a match that should be there. Pictures of a product's other faces have the face on the end of the name, such as -Right or -Bottom, so take that off first, for example with TEXTBEFORE. And the same code can be written with or without leading zeros, as 05057545619308 is, so make both lists the same before you compare them.
When pictures won't load
When Spanner finds a product's picture file but cannot read it, because the file is damaged, isn't really a picture, or couldn't be opened, it writes a small error file named Image Error- and five letters, in your Spanner folder, %localAppData%\Spanner.
- Tools › Open Error Folder opens that folder in File Explorer. Spanner keeps its other logs there too, so it is the place to look if support asks for them.
- Tools › Image Error Check gathers the error files into one list. It asks which folder to look in, with your own Spanner folder filled in; click the green tick. If there are none, it says No Image Error Files.
The Image Files Errors window has a row for each picture that failed: File, its full path, and the ID, UPC and Name of the products it was for.
- Copy Error Details to Clipboard copies the list, with how many times each file failed, to paste into Excel.
- Delete Files with Errors deletes the picture files in the list, wherever they are, and the error files with them.
