neuhaus / ricoh-theta-autoit

AutoIt 3.x Script for batch conversion using the Ricoh Theta for Windows GUI Application
GNU General Public License v3.0
4 stars 6 forks source link

Es startet nur die Ricoh App, mehr passiert nicht #2

Open webstr4711 opened 6 years ago

webstr4711 commented 6 years ago

Hallo, ich möchte dein cooles Script nutzen, um einige Theta-Bilder im batch-Prozess autoleveln.

Leider klappt es noch nicht richtig. habe AutoIt v3.3.14.3 Released Feb 2, 2018 installiert. Win 10 x64

Mittlerweile habe ich es hinbekommen (nach Pfad-Änderung zur .exe des Ricoh-Tools), dass diese App startet. Mehr aber passiert nicht.

Hast du eine Idee, was zu tun ist, damit es funkioniert?

neuhaus commented 6 years ago

Ich habe keine Ricoh Theta mehr. Vermutlich hat sich nur eine Kleinigkeit geändert wie z.B. ein Tastenkürzel

webstr4711 commented 6 years ago

Hallo, schade. Ich kenne mich damit halt absolut nicht aus, könnte dir Theta Dateien zur Verfügung stellen, wenn du es dir angucken magst...

Danke & Viele Grüße

itfelstead commented 6 years ago

Hi,

I've had a quick look and it seems that the latest version of the Theta App doesn't let us supply the image file name on the command line, which is a pain (the script just sits there waiting for the image to load, which it never does). If you try an older version of the Theta App the script should have better luck.

Regards, Ian

beroff commented 5 years ago

But how would one get an older version? It would appear that they only publish the latest.

Is there a chance that the script could go through the UI, rather than the command line?

This script seemed very promising. I hope there's an answer! Thank you!

beroff commented 5 years ago

I played with this a bit and realized that the command line is working to pass the file name!

It would appear that the script stops working once the file is loaded, and it's trying to send keyboard shortcuts, which apparently no longer exist. So I tried replacing those calls with: WinMenuSelectItem($image_file & " - " & $theta_title, "", "File", "Write with top/bottom correction", "JPEG data with XMP") (both with and without the three &'s, in case those were still somehow there), but nothing more happened. Once I selected those menu items manually, the script actually continued forward to the point where it correctly generated a file. I then had to replace all of the _xmp's with _xmp_e's in the script, and I was able to get several files written in a row.

The bottom line is that it appears the Ricoh Theta app is actually fine as is. Once the menu navigation can be precisely determined, it looks like this script might very well work again! :-)

itfelstead commented 5 years ago

Hi, Thanks - I just tried the latest version of the app, and you're right, it does accept the file on the command line. I, like yourself, can't find a nice way to use the menu though.

The only workaround I know of will be to activate the menu with an automated left mouse click (offset 20,40 on my system), then navigate to the menu item via cursor keys. Not ideal, but it seems to work, e.g. to save;

    Opt("MouseCoordMode", 0) ; coords relative to active window
    MouseClick("left", 20, 40, 1, 1 )
    Send("{Down}")
    Send("{Down}")
    Send("{Down}")
    Send("{Down}")
    Send("{Right}")
    Send("{Enter}")

I'll give it a try later if I get time.

beroff commented 5 years ago

Thank you. Yeah, looks like it'd work, but not ideal, especially if/when they change the menu.

Is there some sort of debugging tool that can simply show what the menu items are?

itfelstead commented 5 years ago

Well I've tried loading the app in a resource editor (no joy), and I've tried the spy tool that comes with autoit (Au3Info_x64.exe), which gives me the window class, but still couldn't access the menu due to lack of the menu shortcut key.

As the menus (apparently) aren't standard menus, WinMenuSelectItem doesn't have much luck with them (see remarks in doc). I've tried using ControlCommand, with also didn't work.

Now I'm not an Autoit expert by any means, so there may be another way, but I'm not aware of it :-/

beroff commented 5 years ago

Eh; no worries! Thank you so much for trying! Your "clicking" method should at least get it to do what it needs to do for the moment.

beroff commented 5 years ago

Yep! All I had to do was to add one more Send("{Right}") line, and it then chugged all the way through a full directory!

This is so much faster and simpler than Paul's Level Theta Images, and the output remains in JPG format.

I couldn't find your Donation link anywhere, so if you want to post your PayPal.me link, I'll send you a few bucks. Thanks again!

beroff commented 5 years ago

As I start to use this in production, I'm noticing two things:

I can't seem to click away from the job to do anything else, i.e., the program seems to have to stay on top, in focus, or the whole sequence hangs.

The resulting JPG's are about half the original size. I can't see any difference in quality, but I'm still slightly worried that I'm losing some data. (On the plus side, the leveling is gorgeous!)

itfelstead commented 5 years ago

Hi, sorry for the slow reply;

I can't seem to click away from the job to do anything else, i.e., the program seems to have to stay on > top, in focus, or the whole sequence hangs.

This is the limitation of using something like AutoIt I'm afraid. The script works on the active window - in fact on the window with a specific name.

The resulting JPG's are about half the original size. I can't see any difference in quality, but I'm still slightly worried that I'm losing some data. (On the plus side, the leveling is gorgeous!)

All we're doing it automating menu clicks; it is Ricoh's App that is doing the work: If you did it by hand you should see the same reduction in size. I presume it is because the app uses a higher level of compression than used by the Theta itself (and yes, it does tend to be a lossy compression). Again, not much that can be done about this I'm afraid.

beroff commented 5 years ago

No problem on any of your points! Understood and respected! Thank you for everything!

I imagine that you already have a "latest" version (with the extra Send("{Right}") line), but if for some reason you want me to send you mine, for the next formal version, just let me know.

Thanks again!

itfelstead commented 5 years ago

np

I've just pushed a new version of the script to branch Issue2_shortcutworkaround, which you can try if you like; I've added some new config options to the top of the file. I also had to make it ignore "_xmp_e.jpg" files (in addition to "_xmp.JPG") as they were produced by the two test images I have.

If you're downloading as a Zip (rather than cloning via a local git) then you won't get that version unfortunately, so you'd be better off just copy and pasting the script

beroff commented 5 years ago

OK; thanks!

This generally runs well, as expected. A few times (maybe 10%-20% of the time?) either the input or output directory seems to be set to that of the prior invocation. This can be seen by selecting File > Open, and noting that it's looking in the wrong input directory, and/or screen-shotting the output dialog box, showing the wrong output directory. This is not consistent. Yes, I absolutely ensured that all prior invocations of both the script and the Theta program were terminated before starting the new one. Also, possibly related, one invocation completed as expected, but then just sat at the Theta program screen without the final dialog box indicating completion.

I'm not upset; I can simply re-run the script when necessary. I just thought I'd pass that along.

itfelstead commented 5 years ago

Hi, Thanks for the feedback. I expect it is because I removed the Sleep statements, so it is navigating a bit too quickly, but will try to have a look later in the week.

beroff commented 5 years ago

Thank you! Absolutely no rush!

As it turns out, I've had to revert back to Paul's Level Theta Images, for reasons having nothing to do with the theta_xmp software, (but rather because the Theta app does not seem to be able to transform images which had already been processed by intermediate edits, even if the correct, original EXIF data is reattached with exiftool).

So, I'm happy and not in a hurry. In cases where I'm working on the original downloaded images, theta_xmp will do the job most of the time, and I have an alternate for when it doesn't. So, it's all good!

Thanks again! :-)

itfelstead commented 5 years ago

Hi @beroff,

If you're interested, I've updated the fix branch to calm down the menu navigation. I also added some more error checking (if the expected window doesn't appear after 15 seconds you'll get an error and exit rather than a hang).

However, the only issue I experienced before the fix was that sometimes it would open the wrong menu (which I suspect was because the File menu didn't always appear instantly). so I can't be sure it fixes your issues. It might be worth a try though.

Regards, Ian.

beroff commented 5 years ago

Thank you! I'll certainly test this when I have another batch to process, which I don't have at the moment. I may just re-do an old set, just to test this, when I can come up for air. Thanks again!

beroff commented 5 years ago

OK; I got a chance to test this. It only stopped once during a set of 25 files, with the "TImeout while waiting for the file save window" message, but I was able to start it right back up again, and it seemed to continue processing just fine, without any issues.

I was also able to confirm (in the same test) that the leveling corrections made by the Theta app appear to be identical to those made by Level Theta Images, though I do realize that this is outside of this current project's scope. None-the-less, it's a good thing to know.