Xnviewmp command line parameters ?

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Xnviewmp command line parameters ?

Post by oops66 »

Hello,
Is it planned to add for xnviewmp some parameters for the command line options? (like xnview.exe 2.xx)
http://newsgroup.xnview.com/viewtopic.php?p=51895#51895

ex:
#xnviewmp -capture=desktop
(for screenshot with context menu, I actually use : #sleep 5 ; wine xnview_2.xx.exe -capture=desktop)
...

--- available into xnview 2.xx --- \ info \ command line help ...
Usage: xnview [options] Files
Options:
-all : Open a window For each picture
-browser : Launch the browser
-slide <File> : Launch slide show
-Full : Start in fullscreen
-Fi : Force Fit to Image
-Fa : Force Xnview to Fit Image
-ini <File> : Initialization File
-scan : Acquire the image From the TWAIN device
-capture : Capture the whole screen
-clipaste : Import clipboard

You can use ‘xnview <Folder name>' to start browser.
Last edited by oops66 on Wed Feb 19, 2014 2:14 pm, edited 2 times in total.
XnViewMP Linux X64 - Debian - X64
User avatar
xnview
Author of XnView
Posts: 44916
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Xnviewmp command line parameters ?

Post by xnview »

which parameters are needed?
Pierre.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Xnviewmp command line parameters ?

Post by oops66 »

xnview wrote:which parameters are needed?
...For me, let's start with: -ini «file» and -capture ;-)

Code: Select all

-capture=desktop,d:\screenshot_$.ext
or
-capture=desktop,/home/linux_dir/file_$.ext
$ is a date and time - 08132007_214818

-capture=desktop,c:\file_###.ext
or
-capture=desktop,/home/linux_dir/file_###.ext
# is a number index - #=1, 2, 3..., ###=001, 002, 003...
XnViewMP Linux X64 - Debian - X64
IcePix
Posts: 2
Joined: Sun Feb 16, 2014 9:40 pm

Re: Xnviewmp command line parameters ?

Post by IcePix »

Bonsoir Pierre
I would like to see the "-slide <file>" command line argument enabled in MP. I have a TCC batch file that automatically downloads image files from my camera card to my PC, then runs a full-screen slide show of the new pictures with the command "XnView -fs <file>". I converted the batch file to a Linux shell script but I am obliged to use the default viewer, eog, for the slide show.
Merci
Peter
XnViewMP 0.64. Debian 6.0.9 ("squeeze"), kernel 2.6.32-5-686, Gnome 2.30.2
XnViewMP 0.64. LinuxMint 16 ("petra"), kernel 3.11.0-12-generic, Gnome 3.9.90
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Xnviewmp command line parameters ?

Post by oops66 »

Hello IcePix,
A user friendly workaround is to use a custom nautilus script (from the linux browser) with Wine and the XnView classic version 2.XX....
The custom xnview2.xx nautilus script:
/home/user1/.gnome2/nautilus-scripts/slideshow.sh

Code: Select all

#! /bin/sh

# https://github.com/pydave/daveconfig/blob/master/unix/nautilus/nautilus-scripts/slideshow
# Show all of the pictures in the selected folder in Eye of Gnome.
# (Makes it easy to do a slide show of a hierarchy of folders.)

# Make a temp file using this script's name and the pid
pic_list_file="/tmp/`basename $0`.$$.tmp"

# make sure our temp file doesn't exist
rm $pic_list_file
for i in `seq $#` ; do
    # for each argument find the images in that folder

    # Note: We _should_ be able to pass these directory to find without using a
    # loop, except I don't know how to escape the spaces in filenames.

    # use -print0 and -0 to put NULL at the end
    # of strings so we don't have problems with space
    find "$1" -type f -iregex ".*\.\(jpe?g\|png\|gif\)" -print0 >> $pic_list_file
    shift
done

# send the full list to eye of gnome
#cat $pic_list_file | xargs -0 eog

# avec Wine
#cat $pic_list_file | xargs -0 wine /home/user1/xnview-all/XnView2.13/xnview.exe -full
#or
xdotool key --delay 2000 space & cat $pic_list_file | xargs -0 wine /home/user1/xnview-all/XnView2.13/xnview.exe -full

#xdotool key space
#xdotool key ctrl+l

# http://newsgroup.xnview.com/viewtopic.php?f=60&t=29392#p117459

# XnViewMP
#cat $pic_list_file | xargs -0 xnview

# remove the temp file
rm $pic_list_file
... Then mouse select pics files from the linux browser (nautilus), nautilus-script choose slideshow ...
... Then press "space" to start the quick slideshow (XnView 2.xx in fullscreen mode -- default 2 secondes into the xnview.ini file) ... then "Esc or Echap" to quit.
( or with oeg, start the slideshow in fullscreen with "F5")

... So Pierre, the parameter -full is useful too for the quick slideshow function ;-)
XnViewMP Linux X64 - Debian - X64
User avatar
xnview
Author of XnView
Posts: 44916
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Xnviewmp command line parameters ?

Post by xnview »

See Issue 263 for current status and details.
Pierre.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Xnviewmp command line parameters ?

Post by oops66 »

xnview wrote:See Issue 263 for current status and details.
...Thank you Pierre,
What is working, or not here (Mp_v0.66)...

---------------------------------------
works here:

1-) the -ini parameter
xnview -ini xnview_custom.ini

2-) the -capture # (numbering stamp....., 001, 002, etc)
xnview -capture=desktop,/home/user/dir/file_n_###.jpg

---------------------------------------
Doesn't work here:

0-) the Picture should be opened directly into xnviewMP (like xnview 2.xx version)
xnview -capture=desktop
or
sleep 5 ; xnview -capture=desktop

1-) the -capture $ (time stamp ...., date_time1, date-time2, etc)
xnview -capture=desktop,/home/user/dir/file_$.jpg

*-) But a workaround exist (linux version)
xnview -capture=desktop,/home/user/dir/file_$(date '+%Y-%m-%d_%H-%M-%S').jpg

2-) the -full parameter (open an image in full screen)
xnview -full /home/dir/image.jpg

*Edit1: But a workaround exist too by setting a parameter into
Settings\General\Fullscreen when starting with a file (ticked)


Please, also add the info into the menu: About\Command Line\...
and a "xnview -h" et/or "xnview --help" option to the help.
XnViewMP Linux X64 - Debian - X64
User avatar
Lainagier
Posts: 1
Joined: Sat Oct 27, 2018 3:52 am

Re: Xnviewmp command line parameters ?

Post by Lainagier »

Hello, I'm a longtime Classic devotee newly upgraded to MP (0.92 on Windows 10 Home). I'm bumping this thread to request the reinstatement of the "-clipaste" switch. I've found it very handy to keep a shortcut with -clipaste added, as a one-click way of viewing/editing/saving whatever image I've just copied. (Now it takes two clicks, which is obviously unacceptable :P )

In the meantime, could the parameters that have already been implemented be listed at Help>About>Command Line, à la Classic? It took me a while to hunt the information down myself (plus a test or two) - perhaps other upgrading users would benefit?

Thanks for the amazing work Pierre!
User avatar
xnview
Author of XnView
Posts: 44916
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Xnviewmp command line parameters ?

Post by xnview »

i'll add -clipaste in next version
Pierre.
User avatar
michel038
XnThusiast
Posts: 1408
Joined: Tue Sep 27, 2016 8:18 am
Location: France

Re: Xnviewmp command line parameters ?

Post by michel038 »

I would like to have "-db XnViewSport.db" or "-db Family.db" as a new command-line parameter, in order to work with multiple databases for different collections of photos ...
But perhaps this option will not handle corresponding categories ?
jadO
Posts: 490
Joined: Wed Apr 29, 2015 6:36 am

Re: Xnviewmp command line parameters ?

Post by jadO »

I would like to see a "-path" switch to pass the path to XnviewMP that should be opened in browser.
Then you could pass dynamically the directory to load upon launch instead of only launching the last used directory or always the same standard one.
margu
Posts: 6
Joined: Sun Nov 03, 2019 9:03 am

Re: Xnviewmp command line parameters ?

Post by margu »

Is there a way to open the application in image viewer mode only? I.e. not opening the browser? I.e. the image is opened in a viewing window and when closing this window, the application is closed? This is for other programs which need an external image viewing application. Thanks. Mathias.
cday
XnThusiast
Posts: 4185
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Xnviewmp command line parameters ?

Post by cday »

margu wrote: Thu Nov 07, 2019 10:07 am Is there a way to open the application in image viewer mode only? I.e. not opening the browser? I.e. the image is opened in a viewing window...
In Tools > Settings > General -- General tab there is an option to select whether the application launches with the browser window open...

... and when closing this window, the application is closed? This is for other programs which need an external image viewing application. Thanks. Mathias.
In Tools > Settings > Interface -- Tabs tab there is an option Closing last tab exits XnView if that is what you mean?

I am assuming that if those settings have been previously enabled, then they will apply when starting XnView MP with a command line parameter.
margu
Posts: 6
Joined: Sun Nov 03, 2019 9:03 am

Re: Xnviewmp command line parameters ?

Post by margu »

Sorry I forgot to answer.
Thank you for suggestion but it's not exactly what I need.
For a standard XnView use, I need the browser and I want the browser to be opened first.
And for some applications which need an image viewer, I'd like to open the image viewer only. So different behavior, depending on command line parameters.
orlydb
Posts: 19
Joined: Sat Apr 04, 2020 5:57 am

Re: Xnviewmp command line parameters ?

Post by orlydb »

can you please add a command to load two images in compare mode?