I’m using a macro to analyze 6 different regions of an image file. I want to save each of the 6 masked regions separately into an output directory. Using the macro command “save(outputDir+filename+”.jpg")," has yielded some confusing results.
If files of the same names exist in the directory already, the macro overwrites most of them with the new images, but will occasionally corrupt a file, saving it as “filename.jpg.temp.” It’s not consistent in which file is corrupted, and sometimes it runs without corrupting any. If there are no files in the directory, the program runs without error. If I manually change the file to be “filename.jpg,” it converts to the desired image.
I’m wondering if there are any explanations or work arounds for this. Thanks.