It is currently Mon Mar 18, 2024 10:41 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 295 posts ]  Go to page 1, 2, 3, 4, 5 ... 15  Next
Author Message
 Post subject: ShellOut.py (was XNViewShell) - Call external programs
PostPosted: Fri Jan 07, 2011 12:51 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
EDIT:
This script has been changed to provide Shelling out (calling) many different programs to provide functions not supported by Gimp.
Newest version adds the ability to specify the extension of the temp file to use, i.e. png, bmp, jpg.

Latest script here: viewtopic.php?f=9&t=970&p=17957#p17957

.
.
.
After reading the comments on PSPI and the issues with 2.6.11 I checked my own set, and discovered that many of mine don't work either :( (shows how little I use them, oh well).

So I ran those I could through the Gimp User Filter converters into .guf file, great, but a bunch still were no-go.

Reading about XNView's support made me think, so I modified Michael Munzert's LABcurves python shell script http://www.mm-log.com/lab-curves-gimp to call xnview.

This is python, so you do need that. Just extract the file into your plugin folder and modify the line:
  path = "c:\\PF\\XnView\\"


to reflect where you installed XnView. Mine is in c:\PF but most would be under Program Files, so you WILL have to edit this to get it to work.

It shoes up under Filters->XnView...

It should respect selections, transparency, and layer masks. It saves the file as a temp png, launches XnView opeining that file. Do what you want, then close XnView, saving and overwriting the file. When the plugin sees XnView close, it loads the modified file back in.


-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Last edited by RobA on Tue Apr 05, 2011 2:58 pm, edited 4 times in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 1:26 pm  (#2) 
Offline
GimpChat Member

Joined: Aug 13, 2010
Posts: 23
That is an interesting hack. If it is only about running MM-Filters, I prefer running Photivo [ www.photivo.org ] application instead.

_________________
My photostream: http://flickr.com/neychurluvr/ | I have plenty of CC licensed pictures for your use :-)


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 1:27 pm  (#3) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
RobA, I downloaded your plug-in and placed it in plug-ins in Gimp 2.6.11. I opened the file with Notepad++ and all I can see in there to do with path = is this
Image

I closed Gimp, re-opened it but there is no XnView under filters. That line you said to modify is in there but grayed out. Did I do this wrong?

_________________
Image


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 1:59 pm  (#4) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4037
Molly, did you open an image to work on, first? It will be greyed out until an active workspace is opened.

Rob: Have you tested this in Linux? I actually got this registered and it shows up on the menu in Ubuntu 10.04, but my Xnview is running on Wine so calling up Xnview results in nothing happening at all. I'm tempted to install the Linux version of Xnview but it doesn't support PS plug-ins. :(

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 2:33 pm  (#5) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Yes mav I had an image opened... Do I have to install XnView, the software?

_________________
Image


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 2:37 pm  (#6) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4037
Molly: Yes, you do. Depending on where it saves to, you may be required to alter the path again. That depends on it's installation location, which most likely will be:

"c:\\Program Files\\Xnview\\"

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 3:05 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12509
Excellent. I actually requested something similar for Irfanview a while back with no takers. I happen to have XNView installed too. If all goes well, I might actually upgrade to GIMP 2.6.11. Thanks Rob. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 3:14 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12509
OK; it might be a Win7 issue, but XNView will not launch. The plugin does show up, but nothing happens after I choose layer (or visible option either). Oh well. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 3:31 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12509
The solution. I had to un-install XNView and then reinstall it using the PF path. Maybe Win7's path is disagreable with Python script. Glad that I went this extra mile since this is going to be cool. Thanks again Rob. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 3:43 pm  (#10) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
REALLY COOL !!

:wow RoabA is a script :wizwand


I may try on xp and 7

PS
any chance that may work in linux too ? i use xnview with wine

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 3:51 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
PhotoComix wrote:
PS
any chance that may work in linux too ? i use xnview with wine


Maybe - it would just require changing the command to be the wine launcher.

(I really should have uploaded it with the path already set to Program Files... hadn't realized till after I had though. Sorry for the problems with that.)

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 3:53 pm  (#12) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4037
PC: I got it recognized, but its not working when you select the options. It does nothing. I am not so certain I can simply re-install Xnview, like Lyle did, because the PATHS in Linux are far different than in Windows.

I see Rob A answered your question as I was typing this. I'd already commented about installing in Ubuntu.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 4:02 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12509
One other weird issue. When I actually try to run an adobe filter (only used built in filter earlier) I get missing plugin.dll error and have to say ok a few times then the filter the adobe filter selection shows up and I can run the filter. When I run XNView stand-a-lone, I don't get this error. I can tolerate this issue, but would be cool if someone could explain why. Including the error in capture. :)


Attachments:
xnerr.png
xnerr.png [ 26.19 KiB | Viewed 6420 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 4:09 pm  (#14) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4037
I guess my next question (couldn't find the answer in my Python manual) is when using a Linux path, such as seen here:

# Command line
path = "/home/mahvin/.wine/drive_c/Program Files/XnView"
command = path + "xnview.exe " + "\"" + tempfilename + "\""

Wouldn't the command path (see highlighted) have to follow the same Linux conventions? I tried making backslashes into forward slashes, but that threw str errors.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 4:46 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Okay i tried to install it in XP and i get the dialog to pop-up that asks if i want a new from visible or layer.
No matter which i choose the plug-in seems to load then nothing.I placed this in for path..
# Command line
path = "c:\\Program Files\\XnView\\"
command = path + "xnview.exe " + "\"" + tempfilename + "\""

If i choose from new it actually copies the entire image, which is correct, but then the plug-in just does nothing.
Any ideas?

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 5:52 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12509
I think you have the same issue as I did Rod. I uninstalled XNView and re-installed it under c:\pf directory. I think Python for GIMP doesn't work right with long path names. Might try do use progra~1\\XNView\\ and see if that works. I just went ahead and installed XNView like Rob had it. Also, w.r.t. PS filters, you will get weird error pop-ups, but just click OK til they stop. Small price to pay for being able to use them in GIMP 2.6.11 (which I can now; same problem with 2.6.10 though). One other issue is w.r.t. transparent layers. You will need to save the file externally as a PNG file then drag it on top since XNView doesn't support copy/paste Alpha transference. PC already contacted the XNView team, but I don't know where that issue stands currently. My flow's a little slower now (moved all my PS compatible filters from my GIMP folder to my 8fb folder outside of GIMP except for Impressionist (doesn't appear to work in XNView). GIMP does launch just a little faster now (but I still have way too many brushes and Script-fus). lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 7:14 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12509
Well guess what. It's not GIMPs fault. If you use XNView's build in browser to open an image and then run a PS filter, you get no error, but, if you rightclick and open with XNView and then try to use a PS filter, you get the errors. The problem apparently is with XNView. Not sure if the same issue is with XNView and XP. Still, ignoring the errors by clicking OK a few times will eventually get you to the filter dialogue. :)


Attachments:
ewg.png
ewg.png [ 20.84 KiB | Viewed 6400 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 7:26 pm  (#18) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4037
Image

Well, apparently it's saving (at least) the data to a temp file, but it can't be called back, because it never actually saves to the temp folder (or the temp folder doesn't exist - depends on one or the other). It still doesn't load XnView. And it doesn't revert to XnView when I have it opened in the background.

Oh well, I tried... :)

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 7:47 pm  (#19) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
OK I found a few other things-

The whole command line needs to be quoted if it has spaces, and the popen should have the args broken out.

Try the attached.

mahvin- I'm just using the built in temp location gimp provides. It is likely that the unix path is not accessable inside the wine environment. http://www.winehq.org/docs/winedev-guide/x3016 gives some details.

I'll try setting it up under ubuntu and see, OK?

lylejk - it was the lack of transparency pasting that led me to try this in the first case!

EDIT: Latest script here: viewtopic.php?f=9&t=970&start=20#p10510

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Last edited by RobA on Sun Jan 09, 2011 9:44 pm, edited 1 time in total.

Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 8:00 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12509
It does transfer images that have transparancies Rob (and gives you a new result with transparancies), but, if you use a filter like Cybia's Alphaworks filter, it won't work (Start off with an image with alpha channel of course. It works inside XNView, but it won't get transferred back into GIMP) unless you save the PNG file and drag it back. Not that big a deal though. Not sure why I'm getting all the error messages, but it's not due to your Script or GIMP (see comments above). Not sure if the developers know this and will patch it or not. It could be just my PC too. lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
Post new topic Reply to topic  [ 295 posts ]  Go to page 1, 2, 3, 4, 5 ... 15  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Extended version ShellOut.

1

No new posts Attachment(s) How to call a python filter to run interactively

10



* Login  



Powered by phpBB3 © phpBB Group