Skip to main content
The image converter takes images from a source directory, converts them into one or more target formats, and stores the results in the shop’s directories. What happens in the process is defined in the wsimageconvert.cfg file in the auto-konvertierung directory. The file has two sections. Basic controls what applies to the entire run, that is, transfer lists and the handling of subdirectories. Convert contains one +Entry subsection per target format, with source, target, file type, and the arguments for the conversion program. To edit the file, download it, change it, and upload it back to the server. Guide: Image converter

File structure

Basic

Transfer lists

A transfer list is a text file containing all files that a run has converted. It serves as a handover to downstream systems that need to know which images are new. TransferListDirectory is required as soon as TransferList-Allow is set to yes. You must create the directory manually on the server beforehand; the converter doesn’t create it. TransferListSrcDirectory is optional. Without this parameter, all converted images end up in the list. With it, only those from the specified subdirectory do; all others are left out. TransferListRemoveSrcDirectory can only be used together with TransferListSrcDirectory and strips its name from the entries. The file name of a transfer list consists of the date and a sequential number that restarts each day.
The content is a list of paths, one file per line.

Subdirectories

You can create subdirectories in the source directory auto-konvertierung/quellbilder, for example auto-konvertierung/quellbilder/produkte. The converter searches the source directory including all its subdirectories for files. By default, all converted files are placed flat, directly in the target directory. The structure from the source directory is lost in the process. KeepSubDirectories = yes replicates it in the target directory and creates missing directories automatically. DeleteSrcSubDirectories = yes cleans up the subdirectories in the source directory after the run. A directory is deleted only if it no longer contains any images.

Convert

One +Entry subsection per target format. A source image passes through all entries that match it and thus produces multiple outputs in different sizes and formats.

Required parameters

Name appears in the online service area in the Image converter service on the start page under the heading “Konvertierungs-Formate”. Choose the text so that you can recognize the format there.
These three parameters are required. If any of them is missing, the entire +Entry is silently skipped. No error message appears; the format is simply missing from the result.ConvertArgs must be present but can be left empty. This is necessary, among other things, when converting to webp.The fact that all three parameters are required isn’t described in the previous documentation and has been added here.
The converter normalizes the path in DestDir so that it can’t lead outside the shop directory. Paths with .. therefore have no effect.

Restricting the source

Both settings refer to subdirectories of auto-konvertierung/quellbilder.
Without SrcDir, all directories including the main directory are considered. With SrcDir, only the listed ones are; all others are ignored. You usually need ExclDir only when no SrcDir is set.
ExclDir compares the beginning of the path, not an arbitrary part of it. ExclDir = produkte therefore excludes produkte/gross, but not archiv/produkte. Spaces around the directory names are removed. Neither of these is documented; both have been added here.

File type

If Type is left empty, the file keeps its type. The following table shows which conversions are possible.
The spelling of Type determines the spelling of the file extension. With Type = png, 04531.PNG becomes 04531.png, whereas with Type = Png it becomes 04531.Png.An unsupported conversion doesn’t produce an error message in the shop. The file is just skipped and the reason is written to the log.

Conversion arguments

ConvertArgs contains the command-line arguments that are passed to ImageMagick. This is where you define what happens to the file, such as cropping, padding, scaling, or compressing.
You can override this value for individual source formats. The extensions are recognized regardless of upper and lower case.
The converter splits the arguments at spaces. An argument value that itself contains a space therefore can’t be passed. This isn’t documented and has been added here.
The -sharpen option costs a disproportionate amount of runtime. Even -sharpen 0 doubles the conversion time without sharpening at all. With -sharpen 5, the difference is fivefold. In addition, the file size of the result increases.Sharpening plays a minor role in the final quality of the images. When in doubt, leave it out.

Converting to webp

For webp, the converter works in two stages, because ImageMagick doesn’t generate this format on the platform in use.
  1. ImageMagick applies the changes from ConvertArgs and writes a temporary file.
  2. The cwebp program converts this temporary file to webp using the arguments from ConvertArgs-Webp.
Three conditions must be met for the conversion to webp to work.Type must be set to webp. Without this value, ConvertArgs-Webp isn’t evaluated at all.ConvertArgs must be present, even if it contains no value.cwebp doesn’t support the CMYK color space. Therefore, specify the -colorspace rgb parameter in ConvertArgs; otherwise, the conversion fails for images from prepress.
You can find a list of the possible arguments for cwebp in Google’s documentation at developers.google.com/speed/webp/docs/cwebp.

What happens to faulty source files

The converter checks each source file twice: first the file extension, then the first bytes of the file to determine whether the content really matches the specified format.
If a file fails either of these checks, it’s deleted from the source directory and an entry is created in the error log. The file is gone afterward.This affects files with an unsupported extension as well as files whose content doesn’t match the extension, for example a PDF file renamed to .jpg.This behavior isn’t described in the previous documentation and has been added here. Therefore, never store source images exclusively in the conversion directory.

When something doesn’t work

You can find the error messages of a run in the online service area in the Image converter service.