Utilities · Part 2

Image Folder Tools

Product pictures usually arrive by the folder-full, from a supplier, a photo studio or a website. Image Folder Processing tidies a whole folder at once, clearing white backgrounds and making large pictures smaller. Folder File Details lists what is in a folder, so you can check it against your products. And when a picture won't load, Image Error Check tells you which.

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.

  1. Open Tools › Image Folder Processing. The Multiple Image Files Editor opens.
  2. 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.
  3. In Output Folder, give the folder the results should go to. An empty folder is best.
  4. Click Clear White Space or Scale Images Down to Maximum Size, after setting the options beside it.
  5. 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.

Keep your originals. Set Output Folder to Input Folder makes the results replace the original pictures, and there is no undo. Only do that on a copy of the folder.
The Multiple Image Files Editor: Input Folder C:\Temp\Downloaded Images with 90 files, an empty Output Folder C:\Temp\Processed Images, and the buttons Set Output Folder to Input Folder, Clear White Space with Tolerance 5% and Trim chosen, and Scale Images Down to Maximum Size with a Maximum Size of 150000 pixels
Image Folder Processing, ready to tidy 90 downloaded pictures into an empty folder.

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 .jpg therefore 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.

  1. Open Tools › Folder File Details.
  2. 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.
  3. Each file has a row: File + Extension, File Name Only, Extension and Path.
  4. 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:

  1. List the picture folder and copy it to Excel.
  2. Copy your products' IDs or barcodes from the Product Coding report to the same workbook.
  3. Look one list up in the other, with XLOOKUP or MATCH, 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.

Ask Spanner AI about a few products at a time: "Why doesn't the picture for product 12345 load?" It looks in the folders your image search methods use, and says which files it finds and which face each would load as.
Folder File Details for c:\temp\downloaded images: 100 files listed with File + Extension, File Name Only, Extension and Path. The files are named by barcode, some ending -Bottom or -Right. Copy to Clipboard and Export to Excel are at the foot
Folder File Details for a folder of pictures named by barcode. Pictures of other faces end in -Bottom or -Right.

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.
Delete Files with Errors does not ask first, and there is no undo. A picture on a shared drive is gone for everyone, and a picture can fail just because it was open elsewhere or still downloading from OneDrive. Copy the details first, check them, and delete only when you are sure.
The Image Error Folder window: Enter Folder with Image Errors, with C:\Users\User Name\AppData\Local\Spanner filled in, and the green tick at the bottom right
Image Error Check asks where to look, with your own Spanner folder filled in.
A message reading No Image Error Files, with an OK button
When there are no error files.

Pictures for a whole range?

If you have a lot of products without good pictures, we can help you find, prepare and organise them so Spanner loads them every time.

Email us Book a Demo