Import postprocessing script location

fenschop
Posts: 55
Joined: 24 Jul 08 12:47

Import postprocessing script location

Post by fenschop » 15 Aug 18 12:13

Hi,

I am in the process of moving over form idimager V5 to Photosupreme 4. For IDimager5 I had a post-processing script in the downloader that basically renames timestamp file names when they were not unique due to multiple photo's taken in the same second. So name_001 and name_002 to a prefix with the subsecond information provided by the camera.

I had to adapt three different functions/methods in several places because their parameter list has been changed since. Now it compiles successfully.

In what location should I store the script so that the importer sees the script?

Frank

Hert
Posts: 15909
Joined: 13 Sep 03 7:24

Re: Import postprocessing script location

Post by Hert » 15 Aug 18 14:10

I think that it should appear when copied to
%localappdata%\IDimager Systems, Inc\Scripts\ImportScripts
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

fenschop
Posts: 55
Joined: 24 Jul 08 12:47

Import postprocessing script Selected.Strings

Post by fenschop » 15 Aug 18 17:13

Thanks Hert, it does the trick!

Can I continue to use this thread for further questions getting the script running? In IDIV5 download scripts and scripts ran form UI got their images or filenames served in a different way. See a snippet of my old code:

Code: Select all

  //Downloader script: Selected.Strings is a TTntStringList containing file names.
  //Other scripts: Selected.Items[i] are of type TImageType.
  //TImageType has already properties to extract filenames, path, extension.
  //However, they are not used to make reusable code for Downloader scripts.
  try
    //Rename to base name and make unique automatically
    for i := 0 to Selected.Count - 1 do
    begin
      //++++Downloader section++++
      //OriginalName := Selected.Strings[i];
      //Image := TImageItem.Create(nil);
      //Image.FileName := OriginalName;
      //Image.UpdateFileInfoBase();

      //++++Normal scripting section++++
      Image := Selected.Items[i];

      //++++Downloader section++++
      //First do other tasks on the image
      SetLensInfo(Image.FileName);
Now the Selected.Strings field no longer exists. But I can't figure out how to get the list of imported images or files. I was also unable to located the documentation on the Selected object.

Any suggestions?

fenschop
Posts: 55
Joined: 24 Jul 08 12:47

Re: Import postprocessing script location

Post by fenschop » 15 Aug 18 17:26

With some persistence I was able to "Say"the content of Selected.Items[0].AsString. It seems to be populated with a TXOMObjectStreamerObject that may have a member FileName. Back to the API docs.
PSu4-D1.png
PSu4-D1.png (41.84 KiB) Viewed 973 times
... No, I can't make sense of the screenshot.

Hert
Posts: 15909
Joined: 13 Sep 03 7:24

Re: Import postprocessing script location

Post by Hert » 16 Aug 18 9:14

You have the following objects available;

* Profile; an object of type TDownloadProfile
* Selected; a set of TDownloadImage objects
* FileList; A set of TDownloadImage objects

Off the top of my head; Selected are the original images (source) and FileList are the imported images (target)
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

fenschop
Posts: 55
Joined: 24 Jul 08 12:47

Re: Import postprocessing script location

Post by fenschop » 16 Aug 18 12:52

Thanks Hert,

I can proceed testing tonight. Thanks on the headsup on Selected versus FileList. I will take a look.

I observed that TDownloadImage is not mentioned in the API documentation. (but as long as it has the property FileName, I can proceed converting my script).

Frank

fenschop
Posts: 55
Joined: 24 Jul 08 12:47

Re: Import postprocessing script location

Post by fenschop » 16 Aug 18 19:19

Hi Hert,

TDownloadImage and TDownloadProfile are unknown identifiers. I hope you are able to take a deeper look into the source code.

BTW, is there something of reflection or are there ClassType methods available in this variant of object Pascal?

Frank

Hert
Posts: 15909
Joined: 13 Sep 03 7:24

Re: Import postprocessing script location

Post by Hert » 17 Aug 18 7:50

Those are not available in the scripter. To get the file name only, then it should be possible to cast a TDownloadImage to a TImageItem and then read its file name.
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

fenschop
Posts: 55
Joined: 24 Jul 08 12:47

Re: Import postprocessing script location

Post by fenschop » 17 Aug 18 9:26

OK. Makes sense. The FileName contained in the Selected object is at the new downloaded location. The suggested FileList identifier is not available. To get this working I need to create a new Imagetype object to rename it and to update lensinfo metadata. Do you exepct the following to work?

Code: Select all

      OriginalName := TImageItem(Selected.Items[i]).FileName;
      Image := TImageItem.Create(nil);
      Image.FileName := OriginalName;
      Image.UpdateFileInfoBase();
When TDownloadImage is a child class of TImageItem I may not need to create a new object, but reuse the TDownloadImage which is probably already alive and kicking. Code would simply be:

Code: Select all

      Image := TImageItem(Selected.Items[i]);
Would this work? In case of different inheritance relationships this would be risky code.

Frank

Hert
Posts: 15909
Joined: 13 Sep 03 7:24

Re: Import postprocessing script location

Post by Hert » 17 Aug 18 11:23

The first approach would work.

BTW; do you really need such a script? Did you already try if PSU perhaps already does what you're trying to do? What does your SetLensInfo do for instance....afaik the lens information is already read by PSU
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

fenschop
Posts: 55
Joined: 24 Jul 08 12:47

Re: Import postprocessing script location

Post by fenschop » 17 Aug 18 12:10

My naming convetion is: YYYYMMDD_HHNNSS.
However with multiple photos in same second, I want to extend this with "centiseconds" (CC) information, to be able to get the right sorting. Automatic windows extensions like _1 or _001 did not always adhere to time order I discovered. So: YYYYMMDD_HHNNSS_CC.

But as I do not want to have all my photos like this, because 99.9% is taken in different seconds, I wanted to have the first mentioned convention as default.

So do I need this? Not sure. If automatic duplicate filename numbering would take time order into account it would also be fine. But it doesn't. The other thing is that I have been running this script for almost ten years in IDI 4 and then 5. I may be too old to change habits ;-)

Updating Lens info is because my long sold EOS300D did not put the properties right for the Tamron lenses. No brand name, but not even the focal range was correct. I think my EOS450D needed the same, because I updated the script for this camera. Still using that one.

Stephen
Posts: 657
Joined: 01 Oct 14 10:15

Re: Import postprocessing script location

Post by Stephen » 17 Aug 18 17:45

I rarely shoot at high speed, but my system is similar.

My naming convention is: YYYYMMDD_HHNNSS_1234 where 1234 are the last 4 digits of the image on the card. As this is given, it might be more reliable than using centiseconds or an alternative consecutive numbering scheme. Provided that you set the cameras correctly, it also works well if you are using multiple cameras and wish to have a database of combined images which is chronological.

Sorting by file name will always give a chronological order. 2 or 3 cameras will "never" have the same number of exposures, even if you did press the shutters consecutively.

BTW, I rename automatically on import into PSu - nothing could be simpler.

Maybe food for thought?
Never say never change, but using Mac since 2005. Photo Supreme 3.3.0.2605. I endorse the interoperability of files between applications and systems.

snowman1
Posts: 395
Joined: 01 Jan 07 3:13
Location: UK

Re: Import postprocessing script location

Post by snowman1 » 17 Aug 18 19:18

I use pretty much the same system as Stephen. I actually follow the date/time by the camera model, then the original file name e.g.
20180721_155135_DMC-G3_P1190350.JPG

Not only does the original filename (or in Stephen's case the last 4 digits) supply a sequence for pictures taken in the same second, and guarantees a unique filename, but it also helps if I ever want to match back from the downloaded files to the original card - which is almost never but if one is unlucky enough to have a crash in the middle of the download it can be invaluable. Including the cam model is a bit of overkill but it lets me see at a glance which device the image came from, which is handy (and avoids a filename clash between files from different camera bodies provided they are different models - I guess serial number would also do this - but that's a minor advantage as given a half decent folder structure it is unlikely to be an issue).

All very much personal choice of course, as is folder structure. But this way works for me.
Snowman1
http://www.flickr.com/photos/snowman-1/
--------------------------------------

Stephen
Posts: 657
Joined: 01 Oct 14 10:15

Re: Import postprocessing script location

Post by Stephen » 17 Aug 18 19:45

I concur with Snowman1. BTW, Snowman, are you still OK after the intense heat in many parts of the world recently?

The length of the file name might also be a consideration and was in my case. PSu has limits as to displaying the whole name and concurrently when I started using PSu, a major client restricted file names to 20 characters. That nearly fits in the PSu thumbnail view. In fact it displays the last 18 digits, which is mostly OK as I use the 4-digit year and so only lose the first two digits of the year when viewing. That is why I chopped off everything unnecessary in the file name and just use the last 4 digits from the original image. As snowman states, it's then easy to trace to the original file on your #1 or #2 back-up drive, but it rarely happens.

Good luck fenschop!
Never say never change, but using Mac since 2005. Photo Supreme 3.3.0.2605. I endorse the interoperability of files between applications and systems.

snowman1
Posts: 395
Joined: 01 Jan 07 3:13
Location: UK

Re: Import postprocessing script location

Post by snowman1 » 17 Aug 18 20:41

LOL, I got a bit soft round the edges but fortunately didn't fully transform into a carrot, two lumps of coal and a puddle! :-D
Yes, good point about the file name. PSU does display the full filename of a thumbnail if the cursor is hovered over the filename, which is very useful.
Windows has a total path length restrictions which may also be an issue - I haven't run into that at home but used to have issues wih it at work due to some folder structures used there.
Snowman1
http://www.flickr.com/photos/snowman-1/
--------------------------------------

Post Reply