Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.89k stars 323 forks source link

Automatic External Program Plugger #1307

Closed Beep6581 closed 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 1323

A bit of work, but here we go, as pre-discussed on the forum (see screenshot).
Put the code files in “rtgui” and apply the patch, cmake required.

It searches your PC on start for known programs. You’ll have these programs in an “open
with” menu when selecting images in your file browser. It works with queue processed
as well as raw images.
It expects programs to be installed in the default path, but auto-checks where your
“c:\Program Files” dir is named, as well as 64bit version of the software.

It currently auto-detects: Photoshop CS2 and up, Paint.NET, MS Image Composition Editor
(for panoramas), GeoSetter (powerful tagger and uploader), FastStone Image Viewer
Also added the preexisting option to open a queue processed image using the Windows
Default viewer for that file type (.jpg, .tif…). It was available before with F5, but
not as menu item (the Ctrl-F5 and Shift-F5 have not items).

The context menu can be un-grouped in the preferences menu for quicker access.

The structure is OS independent, just the search-the-program code snipped is OS specific.
It is currently only implemented on Windows but should be easy to add for Mac/Linux.

It’s relatively simple to add new programs, though we should only add programs here
that are widely used and pre-tested to take images on the command line of course (no,
not your obscure private little tool ;-).

Reported by oduis@hotmail.com on 2012-04-13 17:41:06

Beep6581 commented 9 years ago
PS: If someone has suggestions for more programs (only widely used ones with a homepage
and a setup program), please test if they can be started with images from command line.
If so, please provide the DEFAULT install path and exe name.

Reported by oduis@hotmail.com on 2012-04-13 18:09:03

Beep6581 commented 9 years ago
Olli, very cool! 

How about FastPictureViewer, I could get the installation path for Winx64.

Could you clarify - if there is a change to the F5 shortcut. With initial implementation
it would attempt to open a developed image with OS-associated default exe, whichever
that it. Is this still the case?

Reported by michaelezra000 on 2012-04-13 20:02:35

Beep6581 commented 9 years ago
Hi Michael,
Yes, the F5/Ctrl-F5/Shift-F5 shortcuts are still in place. Onlyfor F5 there is an additional
GUI as menu item now (because inspecting the result image with your default viewer
is a pretty common task I think).
If you got more commonly used programs, just go ahead :-)

Reported by oduis@hotmail.com on 2012-04-13 20:13:20

Beep6581 commented 9 years ago
The way it works in Linux is you create a desktop file which associates a bunch of mime
types with a program to open them with, and then this becomes available via the "open
with" menu. That way I can use my obscure private little tool to batch-align focus-stack
enfuse resize and copy metadata from any open program. Implementing a feature that
only works with a few dev-chosen programs isn't a very open thing to do. For Linux
folk it would be much better if this "external program plugger" actually plugged into
our systems and let us use the standard open-with menu.

Reported by entertheyoni on 2012-04-13 21:30:46

Beep6581 commented 9 years ago
Great, then why don't you just add your platform specific Linux code for reading that
config file at the position marked in the source, and you got it integrated in RTs
File Browser.

On Windows it doesn't make too much sense, because e.g. for .JPG there a dozens of
programs registered, including video players, browsers and such that are not really
for photo editing, while other software doesn't register itself. Plus Windows allows
for deeper integration, so it's not just calling a command line, making it more complex
to read them out.

Reported by oduis@hotmail.com on 2012-04-13 21:54:25

Beep6581 commented 9 years ago
Having used Windows for many years I've never had trouble with too many programs in
"open with", nor not enough... Widely used and pre-tested programs should associate
themselves correctly ;]

This is the GTK+3 interface for that:
http://developer.gnome.org/gtk3/3.2/GtkAppChooser.html
Haven't found one for GTK-2.24 yet...

Reported by entertheyoni on 2012-04-14 00:07:34

Beep6581 commented 9 years ago
We are at Gtk+ 2.2x, so can't use that.

On my machine there are 9 progs registered as the "hot list" for jpg, but only 3 are
sensible for photo. And there are many more for jpg as my "second class open with".

The most interesting programs like panorama stitchers don't show up in the "open with"
menu for a good reason. They are Windows Explorer plugins that show up as their own
menu items on right-click when more than one is selected, independed of the "open with"

Then menu items x2 for JPG and RAW files, and you RT right click menu is bloated and
very long, but usable are only 3, and one doesn't show up.
So on Windows it's not really the best way to go.

Reported by oduis@hotmail.com on 2012-04-14 06:24:31

Beep6581 commented 9 years ago
Added plugins for PTGui and Photomatix, which seem to be pretty popular in that arena.

Reported by oduis@hotmail.com on 2012-04-14 07:10:22

Beep6581 commented 9 years ago
Here are more candidates:

x64, probably the same for x32

Stitching:
C:\Program Files\Kolor\Autopano Giga 2.6
C:\Program Files\Kolor\Autopano Pro 2.6

Viewer:
C:\Program Files\FastPictureViewer

Reported by michaelezra000 on 2012-04-14 12:05:25

Beep6581 commented 9 years ago
Thanks, what are the names of the Exes?

Reported by oduis@hotmail.com on 2012-04-14 12:25:23

Beep6581 commented 9 years ago
AutopanoGiga_x64.exe
FastPictureViewer.exe

Reported by michaelezra000 on 2012-04-14 12:27:20

Beep6581 commented 9 years ago
Xnview, enfuse, picturenaut, those two bad pixel finding programs from the manual, align_image_stack,
pixelfixer.

Reported by entertheyoni on 2012-04-14 12:48:10

Beep6581 commented 9 years ago
Great, here is the new version. It also unifies the program searching, so adding a new
program plugin is usually just one line of code now.

@DrSlony: see post above, I need full default install path on Windows. Also you must
test if it works on command line, e.g. picturenaut does not open the files as you would
expect ;-)

Reported by oduis@hotmail.com on 2012-04-14 17:23:00

Beep6581 commented 9 years ago
PS: Since normal viewers are probably on Windows users default open for that file tyte
anyway, we should focus on programs like RAW taggers/DAMs, panorama stitchers, HDR
stitchers.

Reported by oduis@hotmail.com on 2012-04-14 17:24:37

Beep6581 commented 9 years ago
Hi Olli, thanks for these additions, great improvement in code structure as well.

I noticed smth:
SearchProg("Autopano Giga", "Kolor\\Autopano Pro 2...."
should it say "Autopano Pro"?

what about Photoshop Elements, is it usable for this purpose?

Reported by michaelezra000 on 2012-04-14 17:34:48

Beep6581 commented 9 years ago
Well spotted Michael, sorry, copy/paste bug.
Since PS Elements is not mainly a viewer it might be a good candidate I think. Do you
have the full paths?

Reported by oduis@hotmail.com on 2012-04-14 18:07:52

Beep6581 commented 9 years ago
Ok Olli, I'll get those programs' paths on Wednesday when I'm off work and near a pc.

Reported by entertheyoni on 2012-04-16 11:47:23

Beep6581 commented 9 years ago
Great, for Picturenaut I already asked over in the forum, but no answer so far. These
HDRs all have seperate command line tools, hence the GUI EXE don't have a good one.

If you don't mind I'll commit the patch when I come back from work today, as we can
easily add the next bunch now. We should focus on non-viewers maybe.

Reported by oduis@hotmail.com on 2012-04-16 11:57:36

Beep6581 commented 9 years ago
Committed to DEFAULT. I'll leave it open a few days if you got additional programs.

Reported by oduis@hotmail.com on 2012-04-16 16:16:50

Beep6581 commented 9 years ago
Ok, now additional wishes for 4 days, so I'll close it.

Reported by oduis@hotmail.com on 2012-04-21 08:09:41