Saving image script files with image names - v8.0.203

Moderator: jsachs

Post Reply
den
Posts: 859
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Saving image script files with image names - v8.0.203

Post by den »

Image script files are identified for example as "DSCF3151.tif.script", i.e. <name>.image type.script extension and their default location for me is in the same folder as their starting image and resulting image version...

Would it be convenient for others that the Index 1 File 1 parameter of these scripts be ".\DSCF3151.tif" for example rather then the complete path starting with the disc name, ie "C:\...\" ?

I recently re-organized some image folders and/or re-named them and ended up manually changing this script parameter rather than opening, navigating, executing, and re-saving each image script with image names.

...den...
jsachs
Posts: 4398
Joined: January 22nd, 2009, 11:03 pm

Re: Saving image script files with image names - v8.0.203

Post by jsachs »

Using relative pathnames could potentially work OK if the files referenced by the script are in the same folder as the script file, but if not it gets complicated.
Jonathan Sachs
Digital Light & Color
den
Posts: 859
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Saving image script files with image names - v8.0.203

Post by den »

What if this is limited to "File\Save Back..." where the starting image, script, and resulting image version are all in the same folder which is my normal save option?

...and limiting this to just the Index 1 portion of the script would leave complete paths to any other images opened by the script that are in non-relocated/re-named folders...

...but not everyone's processing workflow is the same as mine. ;-)

...den...
jsachs
Posts: 4398
Joined: January 22nd, 2009, 11:03 pm

Re: Saving image script files with image names - v8.0.203

Post by jsachs »

I came across some code I can use to convert full pathnames to relative pathnames, at least in the cases that make sense. As well as working if the file is in the same folder as the script file, this deals with the file being in either a super- or a sub-folder of the folder the script file is in, but reverts to absolute pathnames if the file is on a different drive.

With the help of this code, I could, in some future release, make the choice of relative or absolute pathnames an option when saving scripts. In many if not most cases, relative pathnames should work better than absolute as they will continue to work if you move the script and its related files within the directory structure or to another drive. It would still fail if you moved the script file or the image files to different folders.

Alternatively, if I could save the original pathname of the script file in the script file and then when you load the script file, check to see if it has been moved from its original location and then offer you the option of loading all other files from the same relative position with respect to the script file as the original file was to the original script file, from their original location, or from some other folder. This might be cleaner since the question would only come up if the files had been moved.
Jonathan Sachs
Digital Light & Color
den
Posts: 859
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Saving image script files with image names - v8.0.203

Post by den »

OK... ...you are right. This is not as straight forward as I thought.

In checking the assertion in my previous post, I see that script index numbers can get re-ordered and that <Index 1 File 1 " "> is not the starting image in the case where the script opens another image to be used as an Overlay in the Composite transform, for example, that is not already a workspace version of the starting image. Most of my images scripts comprise branches of the starting image and utilize workspace image versions.

Perhaps best to leave things as is for the time being. Thank you investigating and perhaps adding to the "wish list".

...den...
jsachs
Posts: 4398
Joined: January 22nd, 2009, 11:03 pm

Re: Saving image script files with image names - v8.0.203

Post by jsachs »

I went ahead and for the next release added a line to script (and workspace script) files that records the pathname the script file was saved under. At some future date, I could make use of this to detect if the script file has been moved and if so to optionally adjust the pathnames of image files accordingly.
Jonathan Sachs
Digital Light & Color
Post Reply