Image Logger

The Image Logger function block is designed to save images to a specified folder with a user-defined filename. It maintains a limit on the total number of images stored in the folder, automatically deleting the oldest images as necessary.

πŸ“₯ Inputs

Folder Path The path to the folder where images will be saved.

File Name The base name for the saved image files. Each saved image will append a unique identifier.

Image Limit The maximum number of images allowed in the specified folder. If the limit is reached, the oldest images will be deleted.

Input Image The image data that you want to save.

Trigger A boolean value to initiate the saving process. The image will only be saved when this signal is true.

πŸ“€ Outputs

This function block does not produce any outputs.

πŸ•ΉοΈ Controls

No specific controls are available in this blockβ€”image saving is managed through input parameters and the trigger.

🎨 Features

Dynamic Image Saving Automatically saves the provided image whenever the trigger is activated.

Image Limit Management Keeps the total number of images under the specified limit by deleting the oldest images when necessary.

Flexibility Supports customized folder paths and file names for organized storage.

πŸ“ Usage Instructions

  1. Specify Folder Path: Connect a string containing the path to the folder where you want to save images.

  2. Set File Name: Connect a string specifying the base name for saved image files.

  3. Define Image Limit: Specify the maximum number of images to keep in the folder.

  4. Input Image: Connect the image you wish to save.

  5. Trigger Saving: Send a true signal to the Trigger input to save the image.

πŸ“Š Evaluation

When activated via the trigger, this function block saves the provided input image to the specified folder with the specified filename. It manages the number of images stored by deleting the oldest files as needed.

πŸ’‘ Tips and Tricks

Using Unique Filenames

To avoid overwriting files, consider appending a timestamp or a unique identifier to the File Name input. This can be achieved by combining it with Date-Time.

Managing Different File Types

If you need different file formats, modify the image_path by changing .png to any supported format like .jpg.

Creating a Save Directory

Ensure the specified folder already exists to avoid errors. You can create a folder beforehand by using File/Folder Operations block.

πŸ› οΈ Troubleshooting

Image Not Saving

Make sure the provided folder path is valid and that you have permissions to write in that directory.

Trigger Not Activating

Verify that the trigger input is being set to true when you want to save the image; otherwise, the saving process will not be initiated.

Exceeding Image Limit

Check if the Image Limit is set appropriately. If your limit is exceeded, some images will be automatically deleted. Adjust the limit if you want to retain more images.

Last updated