Beep6581 / RawTherapee

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

Update external editor documentation #5474

Open Beep6581 opened 4 years ago

Beep6581 commented 4 years ago

In light of recent changes (#5473 and 5b72cc0dd), this needs updating: http://rawpedia.rawtherapee.com/Preferences#External_Editor

For Linux, Windows and macOS, provide three working examples as follows:

  1. Pass the image to a program with no space in its filename (rename the executable for testing purposes as needed), e.g. C:\Program Files\Adobe\Photoshop\photoshop.exe or /home/bob/programs/hdrmerge/hdrmerge.
  2. Pass the image to a program with a space in its filename (rename the executable for testing purposes as needed), e.g. C:\Program Files\Adobe\Photoshop\Adobe Photoshop.exe or /home/bob/programs/hdrmerge/hdr merge.
  3. Pass the image to a program with a space in its filename with a parameter. The parameter should have an observable effect so that you can confirm that it was parsed correctly, e.g. /usr/bin/gee\ qie --remote or open -a "Adobe Photoshop CS6" --some-parameter (I don't know how to pass a parameter to a program in macOS, because its not documented).

I need help with Windows and macOS, you can write the command lines here.

blj86 commented 4 years ago

I can help a little bit here with MacOS. They made some useful tweaks that allow passing of arguments to application with the open command in 10.6.2+. So any version prior it will not work.

  1. open -a hdrmerge

  2. open -a "Adobe Photoshop CS6"

  3. open -a "Adobe Photoshop CS6" --args <arguments here>

For some more reference here is the man page for the open command on 10.14.6 open.txt

Edit: I am pretty sure the image being passed will have to be before the --args flag according to what I see in the man page

Beep6581 commented 4 years ago

Hi @blj86 , thank you for helping. Which version of RawTherapee did you test?

blj86 commented 4 years ago

@Beep6581

I have done no specific tests as of this moment. Just passed some information as I stumbled upon this while checking to see if their was info about a crash fix for 5.7 on MacOS.

If you have a specific version you need tests for let me know and I will look into figuring out a build setup. I am loving RT so if I can help a little with what little skills I have I am willing.

Beep6581 commented 4 years ago

@blj86 the point here is to test whether the three forms of invocation work correctly when used in RawTherapee via the "Open with external editor" button and to document that accordingly. To that end, testing should be done using 5.7-121-g741bfed52 or newer.

blj86 commented 4 years ago

@Beep6581

Ok sounds good will try to get a local build put together later tonight after work and run some tests asap. Best way I can give back as I am not good enough with coding to contribute that way.

blj86 commented 4 years ago

@Beep6581 Update ran some tests. Had some issues with getting the bundle I built to run but I was able to run the build by executing the built file instead of the bundle.

I used 5.7-122-gbd3c8a206

Yes it seems the full bundle path is needed for the application will not work otherwise.

  1. open -a /Applications/GIMP-2.10.app = Works
  2. open -a "/Applications/GIMP-2.10.app" = Works (Spaces Test this is more of just to see if it works. this application can't open images but it still launches properly in this test it is the only app I have currently with spaces in the name)
  3. open -a /Applications/Photo\ Booth.app = Works
  4. open -a "/Applicatoins/Photo Booth.app" = Works
  5. open -a /Applications/GIMP-2.10.app --args -a = FAILS
  6. open -a "/Applications/GIMP-2.10.app" --args -a = FAILS

So -a in gimp opens the image as a new image tab in the editor. Through some manual command line testing the arguments do work but the formatting is very important.

open -a /Applications/GIMP-2.10.app <file> --args -a open -a "/Applications/GIMP-2.10.app" <file> --args -a

In other words the list of files being passed to gimp on MacOS must come before the arguments you are passing to GIMP. So this particular edge case on MacOS may need some special code written to reformat the external command to ensure the --args comes after the actual image being passed through.

Hope this is helpful.

Lawrence37 commented 2 years ago

The documentation also need to explain the output directory section added in #6232. It should be clear that images saved to the temporary directory may be automatically removed by the operating system, typically on reboot for Linux and macOS (see https://discuss.pixls.us/t/external-editor-adobe-photoshop-installation-directory/27994/13). The page on saving images implies that sending an image to an external editor is enough to save it. There should be a sentence to say that images aren't really saved until it is saved using the external editor or if the external editor output directory is not a temporary directory.