JacobDev1 / xl-converter

Easy-to-use image converter for modern formats. Supports multithreading, drag 'n drop, and downscaling.
https://codepoems.eu/xl-converter
Other
167 stars 5 forks source link

Please explain the logic of the converter’s behavior in this situation (description below) #30

Closed Ukhryuk-Hai closed 4 months ago

Ukhryuk-Hai commented 4 months ago

Suppose there are several files in one folder with the same name, but in different formats (which the converter understands). If I send them for processing at the same time (multithreading option), what will happen then? Will the converter consider that some files have supposedly already been processed and skip them? Or will it silently delete and overwrite the file? I'm guessing you've added some logic to handle this situation, however I'm not sure if this will work in multi-threading.

JacobDev1 commented 4 months ago

By default, XL Converter will pick a new and unique name if a file of the same name is encountered.

Avoiding naming collisions is handled by using mutexes. This means only a single operation of generating a unique file name can be executed at a time.

To make this more effective, an image is generated at first under a temporary name with extra characters (for example, file_0a5.jxl) which is renamed to the expected output when the conversion finishes.

This behavior is controlled by the "Duplicates" combo box. If you set it to Replace, the program will remove files with the same name.

Ukhryuk-Hai commented 4 months ago

Thank you.