# Image Stack
Disclaimer: This is an advanced topic! Make sure to gain a good understanding of the usual logic of the configurator before reading this.

## Introduction
 - The ImageStack is the list of images that are displayed in the viewer.
 - The images will be stacked on top of each other to create the final visual.
 - This is the final step in the assembly of content to the final visual.
 - Each Configuration can be displayed by a specific ImageStack.
 - Each image in the ImageStack is called a layer.

## Rendered Content
Warning: Please make sure you understand the rendering process. Otherwise the following topics might be confusing.

 - The generated Content looks something like this:
   - SomeViewpoint/SomeCombinationOfOptions/SomeCombinationOfVariants.png
 - or as Syntax:
   - SomeViewpoint/AB/A2B1.png

## ImageStack Rules
 - Each Option of a Viewpoint will be represented in exactly one folder.
 - Each folder will provide exactly one file to the ImageStack.
 - Each Option folders is assigned to a Layer or the lowest layer by default. 
   - The Options need to be ordered accordingly.
   - The order of the images within a Layer doesn't matter.

## ImageStack Creation
 - The FTP Server provides a list of files using PHP.
 - The server will already clean up the files and assign each file to the displayed Options and Variants. The result is returned as a data package with everything required to build ImageStacks.
   - Example: Some Image shows Variant 02 of Option A and Variant 01 of Option B.
   - as Syntax: Image shows A02 B01
 - The Editor frontend provides different error reports to identify missing files and problems with the matching from the image list to the strapi data.
 - The Viewer frontend assembles the ImageStack based on the current Configuration.
   - In the simplest case, all images can be checked. If the image matches the Configuration, it should be displayed.
   - If Dynamic Options are used, this process gets a bit more complicated. Please make sure you understand Dynamic Options. The algorithm needs to provide a complete visual, even when the set of selectable Options changes.
   - Once the needed Images are identified, they need to be ordered according to which Layer the Options belong to.