Author Topic: Script for Automatic Multiple instances of cr2hdr (Windows)  (Read 34752 times)

orim

  • New to the forum
  • *
  • Posts: 22
  • 50D / 70D
Re: Script for Automatic Multiple instances of cr2hdr
« Reply #25 on: October 29, 2013, 11:10:21 PM »
perfect, thanks.
it works now as expected. :)
HaND!

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr
« Reply #26 on: October 31, 2013, 12:04:52 PM »
Now it always puts the dualisos, compressed dngs, and regular cr2s in a folder. See the options.

feureau

  • Hero Member
  • *****
  • Posts: 604
Re: Script for Automatic Multiple instances of cr2hdr
« Reply #27 on: December 19, 2013, 09:05:44 PM »
This is awesome :D

Thanks for this

PatrickAlessi

  • New to the forum
  • *
  • Posts: 1
Re: Script for Automatic Multiple instances of cr2hdr
« Reply #28 on: December 30, 2013, 11:38:16 PM »
How to do this on a mac??

Maybe run a windows application and run the script from there?

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #29 on: December 31, 2013, 10:42:16 AM »
I don't have a Mac. I'm sure there's a Mac solution somewhere here, though.

l_d_allan

  • Senior
  • ****
  • Posts: 258
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #30 on: January 21, 2014, 03:16:44 PM »
In the script, it seems that the command line wants an argument for the actual directory where the .cr2 files are. I use a command line of either
VbsScript S:\MyCr2Dir   or
VbsScript .

Otherwise, the script prompts for a subdirectory.

Would it be ok to have a line in the script hear the top:
'------------------------------------------------------------------
cr2hdrpath="S:\MyCr2Dir"
inputfolder=cr2hdrpath

and then comment out lines that invoke the Open dialog?

' if Wscript.Arguments.Count>0 then
'   inputfolder=Wscript.Arguments(0) 'command line
' else
'   inputfolder=getfolder("Select the folder containing the dual ISO .CR2 files.")
'  if inputfolder="" then WScript.Quit
' end if

Also:
'cr2hdrexe="cr2hdr.exe"
cr2hdrexe="cr2hdr-cmd.exe"

Just checking ... in the .vbs script, is the version with the filename cr2hdr-cmd.exe a modified version of the normal cr2hdr.exe, except with additional debugging options?

Also, I'm confused on what the following line does:
deleteoriginaldng=true

It doesn't seem to make any difference whether it is true or false.
The original .cr2's are still deleted, regardless, from the original directory with the cr2hdr.exe and .cr2 files:
cr2hdrpath="S:\MyCr2Dir"

That was unexpected.

The .cr2 files do seem to be preserved in the created subdirectories:
"Regular CR2s"
"Dual ISO CR2s"

So I guess that is fine.



l_d_allan

  • Senior
  • ****
  • Posts: 258
HowTo? Run .vbs script at priority = /belownormal?
« Reply #31 on: January 21, 2014, 05:38:18 PM »
Ok, I am vbs illiterate.

Is there a way to run the script at lower priority so it doesn't reduce the responsiveness of the foreground window?

such as a change to statement:
    WshShell.Run line,windowtype,false

From the command line, you can use:
start /belownormal cr2hdr .....

Also, the script seems to remove Rating Stars and Label Colors that were in the .xml sidecar files. They were put there with Adobe Bride. I used Stars
and Labels to keep track of which files were in what category:
* 6d or 5d2
* Dual-ISO or non-Dual-ISO
* _MG or _UAL or _0

Is that "as expected"?



engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #32 on: January 22, 2014, 06:03:00 AM »
Updated, see options at the top of the script.

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #33 on: January 22, 2014, 06:05:32 AM »
Quote
Would it be ok to have a line in the script hear the top

You could just do that and answer your own question. Nothing's going to explode if you edit it. The whole advantage of using this is that you can customize it. Anyway, there's a line where you can put your own input directory now.

Quote
is the version with the filename cr2hdr-cmd.exe a modified version of the normal cr2hdr.exe, except with additional debugging options

It's an old version.

Quote
deleteoriginaldng=true

This deleted the uncompressed dng, but it's no longer relevant.

Quote
Is there a way to run the script at lower priority

Reduce maxprocs.

Quote
Also, the script seems to remove Rating Stars and Label Colors that were in the .xml sidecar files.

It doesn't move any .xml files. Run script first then edit.

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #34 on: January 30, 2014, 09:29:13 AM »
Moar updates, see first post.

l_d_allan

  • Senior
  • ****
  • Posts: 258
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #35 on: January 30, 2014, 03:03:11 PM »
Thanks. Looks good.

Several minor revisions to consider:
dualisocr2dir="Dual ISO CR2s"
regularcr2dir="Regular CR2s"
dngoutputdir="Dual ISO DNG"

* Consider having dashes or underscores or CamelCase, instead of spaces in filenames
* Consider having plural DNG for consistency with plural CR2s

Here's what I use, with verbose hints to myself on what to do with them next:
dualisocr2dir="Dual-ISO_CR2s_ToArchive"
regularcr2dir="Regular_CR2s_ToProcessWithDngConverter"
dngcoutputdir="Dual-ISO_CR2s_2_Compressed_DNGs_Done"

* Consider having the variable for inputfolder up at the top with the variable for cr2hdrpath. I'd think the preferred default would be:
inputfolder=cr2hdrpath

Also, would it be possible to have an option for the script to proceed to process the "Regular CR2s" that were not Dual-ISO with DngConverter? Could that be the default?

FWIW: With my 2600k that has 4 cores and multi-threading, use of
maxprocs=7
instead of 8 procs
still pretty much pegs the Windows TaskManager cpu monitor, and makes the computer unresponsive.

I've been launching a Cmd window, setting its priority to BelowNormal, and then launching the .vbs script from that. That keeps the foreground window responsive instead of very sluggish.  Am I doing something wrong?



engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #36 on: January 30, 2014, 06:52:56 PM »
Quote
Am I doing something wrong?

Yes.

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #37 on: January 31, 2014, 04:23:52 PM »
Only tried on a few files but it should now correct green tint. Set exiftoolpath and correcttint in the options.

Pacman

  • New to the forum
  • *
  • Posts: 4
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #38 on: March 30, 2014, 07:15:19 PM »
I really like your script.
But the newer Version doesnt work for me.

I have put the Script, the cr2hdr.exe and the exiftool.exe into the folder C:\cr2hdr\.
And change of course:
cr2hdrpath="C:\cr2hdr\"
and
exiftoolpath="C:\cr2hdr\"

But ifi run the script, it says "No DNG files created. Check script options and log.".

Code: [Select]
Started: 30.03.2014 19:11:48

Input folder is C:\Users\Pacman\Pictures\test

Searching for .CR2 files
Queued cmd.exe /c ""C:\cr2hdr\cr2hdr.exe" --compress "DUAL8298.CR2" > DUAL8298.CR2.log "
Queued C:\cr2hdr\exiftool.exe DUAL8298.dng -asshotneutral="0.473635 1.05 0.624" -overwrite_original

Converting Dual ISO .CR2 files
Executing: cmd.exe /c ""C:\cr2hdr\cr2hdr.exe" --compress "DUAL8298.CR2" > DUAL8298.CR2.log "

Running exiftool
No DNG files created. Check script options and log.

It seems, that the script ignore the Inputfolder.

Do you have any ideas?

Thanks
Ronald

P.S.: And one little other wish, i have.
Can you add your script a Versions Number. So i can see, if you change anyting.
Thanks a lot ;op

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #39 on: March 30, 2014, 09:05:23 PM »
Quote
Make sure all paths end with a "\", ie. "C:\cr2hdr\"

Try adding a slash to the end of all paths. It should work fine with long paths too.

I also just updated it to remove the tint adjustment. (It won't work with most cameras, and is incompatible with the latest cr2hdr.) Also a couple of other bugs that would prevent it from working for anyone but me probably.

I'll just add a date to the top of the script.

Pacman

  • New to the forum
  • *
  • Posts: 4
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #40 on: March 31, 2014, 07:57:56 PM »
Thanks for the quick answer.

The date at the top of the script is great  :D.

But the Script doesnt work   :(
It finds my CR2 Files, but doesnt do anything.
The DUAL8298.CR2.log looks like this.

Code: [Select]
cr2hdr: a post processing tool for Dual ISO images

Last update: d0ac769 on 2014-01-23 10:13:39 UTC by alex:
cr2hdr: experimental white level routine with two separate levels ...

Active options:
--amaze-edge    : use a temporary demosaic step (AMaZE) followed by edge-directed interpolation (default)
--cs2x2         : apply 2x2 chroma smoothing in noisy and aliased areas (default)
--compress      : Lossless DNG compression

Input file      : DUAL8298.CR2
Camera          : Canon EOS 5D Mark III
Full size       : 0 x 0
Active area     : 0 x 0

But i didnt have a 5D Mark III and the files size is not correct to.
If i put my test file into a other paths (C:\Test\) it doesnt work too.
The only way to make it work, is copy the cr2 into my working paths "C:\cr2hdr\".

i added of course a slash to the end of all paths.

Do you have any other ideas?

Thanks a lot
Ronald

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #41 on: March 31, 2014, 09:44:54 PM »
Did you change the cr2hdr path in the script? Please check all the script options and make sure everything is set correctly. Also read all the directions above and comments in the script by all the settings. If you did all that, post your config (the top settings of the script).

Pacman

  • New to the forum
  • *
  • Posts: 4
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #42 on: April 01, 2014, 06:40:41 PM »
Thanks for your help.
i dont see, what iam doing wrong.

Here is my config part:
Code: [Select]
'------------------------------------------------------------------
'last update: 3/30/2014

cr2hdrpath="C:\cr2hdr\" 'ends with a slash \
cr2hdrexe="cr2hdr.exe"
cr2hdrargs="--compress"

exiftoolpath="C:\cr2hdr\" 'ends with a slash \
inputfolder="C:\pictures\" 'dialog will start at this folder if set (ends with a slash \)

dualisocr2dir="Dual ISO CR2"
regularcr2dir="Regular CR2"
dngoutputdir="Dual ISO DNG"

organize=true 'sort files into subdirectories when done processing
correcttint=false

maxprocs=4 'Number of simultaneous processes
windowtype=7
'0 Hide the window and activate another window.
'1 Activate and display the window. (restore size and position) Specify this flag when displaying a window for the first time.
'2 Activate & minimize.
'3 Activate & maximize.
'4 Restore. The active window remains active.
'5 Activate & Restore.
'6 Minimize & activate the next top-level window in the Z order.
'7 Minimize. The active window remains active.
'------------------------------------------------------------------

This part of the log Files is confusing me.
Code: [Select]
Executing: "C:\cr2hdr\cr2hdr.exe" --compress "DUAL8298.CR2"Why i dont see my Paths there?

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #43 on: April 02, 2014, 09:43:57 AM »
Code: [Select]
Started: 4/2/2014 2:35:34 AM

Input folder is C:\pictures

Searching for .CR2 files
Queued "C:\cr2hdr\cr2hdr.exe" --compress "IMG_7361.CR2"

Converting Dual ISO .CR2 files
Executing: "C:\cr2hdr\cr2hdr.exe" --compress "IMG_7361.CR2"

Moving Dual ISO .CR2 files
Created "C:\pictures\Dual ISO CR2"
Moving "C:\pictures\IMG_7361.CR2" to "C:\pictures\Dual ISO CR2\IMG_7361.CR2"

Moving any regular .CR2 files

Moving Dual ISO .DNG files
Created "C:\pictures\Dual ISO DNG"
Moving "C:\pictures\IMG_7361.DNG" to "C:\pictures\Dual ISO DNG\IMG_7361.DNG"

Moving log files

Processed 1 file(s). Converted 1 Dual ISO(s). Runtime: 19.61 seconds.

Created "C:\pictures\logs"

Just tried those folders and it works for me. It doesn't show the path at that point. Check to make sure that file is valid. Run cr2hdr on it from the command prompt manually.

There's also a couple other solutions to running multiple cr2hdrs in this section if you haven't tried them.

Pacman

  • New to the forum
  • *
  • Posts: 4
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #44 on: April 02, 2014, 11:37:31 AM »
I have tested and i dont understand it  :P.

In the folder C:\cr2hdr\ i have the "cr2hdr.exe" "dcraw.exe" "exiftool.exe" und your vbs script.
In the folder C:\Test\ i put a dual iso test image.

if i run the script in the folder C:\cr2hdr\ it doesnt work.

If i put the "cr2hdr.exe" "dcraw.exe" "exiftool.exe" files in the folder C:\Test\ too.
It works like a charm if i start the script in the folder C:\Test\.  ???

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #45 on: April 03, 2014, 01:42:52 AM »
The script works by running cr2hdr with the current directory set to the folder containing the images. This is because I couldn't cr2hdr to work correctly with paths and file names. The current directory is set at the line wshshell.currentdirectory=inputfolder. You can check if the current directory is properly set (to c:\test) with msgbox wshshell.currentdirectory. You also might try replacing the line wshshell.currentdirectory=inputfolder with wshshell.currentdirectory="c:\test".

jodaboda

  • New to the forum
  • *
  • Posts: 11
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #46 on: June 29, 2014, 02:13:34 AM »
Is there a way to change multiple_cr2hdr.vbs so that I can move the folder around and it will still work?  By that I think I mean have all the extra files in the same directory as multiple_cr2hdr.vbs, and just drop CR2 files in the same directory and run it.

I think this requires setting the paths relative to multiple_cr2hdr.vbs script...

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #47 on: June 30, 2014, 08:21:11 AM »
At the top:

inputfolder=left(wscript.scriptfullname,instrrev(wscript.scriptfullname,"\"))

And maybe comment out inputfolder=getfolder(...

jodaboda

  • New to the forum
  • *
  • Posts: 11
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #48 on: July 01, 2014, 01:24:09 AM »
Thanks so much!

For anyone else interested, you can change all of these, if desired:


cr2hdrpath=left(wscript.scriptfullname,instrrev(wscript.scriptfullname,"\"))
exiftoolpath=left(wscript.scriptfullname,instrrev(wscript.scriptfullname,"\"))
inputfolder=left(wscript.scriptfullname,instrrev(wscript.scriptfullname,"\"))


Works great for me.  I just drop my Raw files in the same folder as the script and run  the script.  done!

thanks!

jodaboda

  • New to the forum
  • *
  • Posts: 11
Re: Script for Automatic Multiple instances of cr2hdr (Windows)
« Reply #49 on: July 02, 2014, 12:27:10 AM »
I'm also (especially) interested in having it work for .dng files as made from ML RAW dual-ISO video.  It seems to only work for my CR2 stills...