Image conversion

This is for v10 on Win x64 -7. Please see code below - I think this used to work but when run on multiple selected images
It fails to delete them after conversion?? Am I missing something? When run on one image it does delete it, so it's not a
permissions issue.... really need this so any help would be super thanks.


I don't think that command would ever deleted the original file(s) if it's being used to convert non-JPG images to JPG. The REPLACE argument only affects what happens if a file with the new name & extension already exists; it doesn't mean "delete the source file".

(The source file may be the same as the destination file, but only when not changing the image format. Since the quality is at 100 and no scaling or rotation is being applied, the command doesn't make sense for use with JPG inputs, so I'm assuming it's not being used on them.)

If you want to convert non-JPG to JPG and then delete the non-JPG files, you'd need to add the Delete command. (And be careful not to select any JPG files, or add a Select command to ensure any selected by mistake are de-selected before the Image and Delete commands run.)

Ok got it... thanks.
I already wrote one that does that but having to wait for hundreds of files...
So if I use the below code... ? Can I safely run this multiple times or is the variable used globally so they might conflict or
is it stored within the function... ? Thanks.

@set currentFiles {F} Image CONVERT=jpg PRESERVEASPECTRATIO QUALITY=100 HERE REPLACE=always Delete {"$currentFiles"}

By multiple I mean run it several times similtaneously...

Just testing the above and it is working fine for me - hopping directory to directory converting tga-png and removing the old tgas. Thanks so much for the help and speedy response.

You don't need the first line or {currentFiles} at all. Delete works on the selected files by default.

Here's what I use (with Opus 11; untested on Opus 10):

@nodeselect Image HERE CONVERT=jpg Delete FILTER=*.(bmp|png)

The filter at the end makes sure I don't delete any selected JPG or non-image files by mistake, as I know I'd only ever convert BMP or PNG to JPG.