It is currently Thu Apr 25, 2024 7:55 am


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: 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: 4045
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: 12518
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 7102 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: 4045
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: 12518
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: 12518
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 7082 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: 4045
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: 12518
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 subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 8:04 pm  (#21) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
Let me try this again...

It's no go on Win7 64bit. I don't want to install XnView in the regular "Program Files" directory, as this is reserved for 64 bit programs. I am looking into another option.

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 8:06 pm  (#22) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4045
PM:

You can change the path in the PY file to suit the installation location. You just need to use double \\ .

I wish I could get it to work in Ubuntu, how sweet that would be.

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


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

Joined: Sep 24, 2010
Posts: 12518
OK; The original image as embedded alpha and the result shown is after I ran Cybia's Alphaworks filter and got placed back into GIMP (identical as before running the filter). The second version how it should be. I saved it while still in XNView. I have an idea why this is happening. Maybe if you can figure out how to paste it back in another layer besides the calling layer, you can get the proper result. :)

Attachment:
ducky_fill.png
ducky_fill.png [ 209.71 KiB | Viewed 6848 times ]


Attachments:
gimp-temp-210415.png
gimp-temp-210415.png [ 268.73 KiB | Viewed 6848 times ]

_________________
Lyle

Psalm 109:8

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

Joined: Sep 24, 2010
Posts: 12518
Ah; just tried it with a layer that already has transparancy components and the result that comes back is different then if I saved it externally further backing what I think is the problem. :)

What should be the result:

Attachment:
gimp-temp-210418.png
gimp-temp-210418.png [ 338.69 KiB | Viewed 6846 times ]


What comes back inside GIMP:

Attachment:
gimp-temp-210415b.png
gimp-temp-210415b.png [ 317.45 KiB | Viewed 6846 times ]

_________________
Lyle

Psalm 109:8

Image


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

Joined: Oct 06, 2010
Posts: 4045
Rob: I don't know how I missed your post. I thought I was keeping a good eye for any replies and somehow I missed your post. Hmmm... Anyway, thanks for trying. I truly appreciate that.

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


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 8:54 pm  (#26) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
mahvin wrote:
Rob: I don't know how I missed your post. I thought I was keeping a good eye for any replies and somehow I missed your post. Hmmm... Anyway, thanks for trying. I truly appreciate that.


OK - I installed wine and xnview and this seems to work:
  # Use temp file names from gimp, it reflects the user's choices in gimp.rc
  # change as indicated if you always want to use the same temp file name
  tempwinfile = "C:\\Windows\\Temp\\tempfile.png"
  tempfilename = "/home/rob/.wine/dosdevices/c:/windows/temp/tempfile.png"

  # !!! Note no run-mode first parameter, and user entered filename is empty string
  pdb.gimp_progress_set_text ("Saving a copy")
  pdb.file_png_save_defaults(tempimage, tempdrawable, tempfilename, tempfilename)

  # Command line - Change to match where you installed XnView
  command = "/usr/bin/wine \"C:\\Program Files\\XnView\\xnview.exe\" \"" + tempwinfile + "\""
  gimp.message(command)
  args = shlex.split(command)


Just replace the bits of the previous version and change your home/rob/ path to yours.

This is necessary to overcome the wine/linux paths.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


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

Joined: Oct 06, 2010
Posts: 4045
Results:

Traceback (most recent call last):
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 692, in response
dialog.res = run_script(params)
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 353, in run_script
return apply(function, params)
File "/home/mahvin/.gimp-2.6/plug-ins/XNViewShell.py", line 73, in plugin_main
args = shlex.split(command)
NameError: global name 'shlex' is not defined

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


Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 9:14 pm  (#28) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
lylejk wrote:
Ah; just tried it with a layer that already has transparancy components and the result that comes back is different then if I saved it externally further backing what I think is the problem. :)


I think I figured it out. It was pasting into the original selection, so if the filter removed alpha, the old image showed through...

Try the attached.


Attachments:
XNViewShell.zip [1.84 KiB]
Downloaded 855 times

_________________
Image
Fantasy Cartography and Mapping by RobA
Top
 Post subject: Re: XNViewShell
PostPosted: Fri Jan 07, 2011 9:15 pm  (#29) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
mahvin wrote:
Results:

Traceback (most recent call last):
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 692, in response
dialog.res = run_script(params)
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 353, in run_script
return apply(function, params)
File "/home/mahvin/.gimp-2.6/plug-ins/XNViewShell.py", line 73, in plugin_main
args = shlex.split(command)
NameError: global name 'shlex' is not defined


oops. Forgot. Add a
import shlex

with the other imports

I'm just duffing so I hope this works, at least well enough for you to figure it out.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


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

Joined: Sep 24, 2010
Posts: 12518
Your new version worked Rob (of course had to change the path back to PF in my case; lol). Thanks a heap. :)

_________________
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