Running jAlbum from the command line

Revision as of 14 July 2021 20:38 by RobM (Comments | Contribs)

The jAlbum application can also be controlled from the command line. It accepts the same parameters as you are able to set through the graphical user interface.

The following examples will work, as is, for nearly all installations. However, if you have problems running jAlbum from the command line ensure that either:
The command starts with the path to jAlbum’s bundled Java
Or
That the Java PATH variable elements has jAlbum’s bundled Java before any other Java installations.
For example, Windows users should use "C:\Program Files\jAlbum\jre64\bin\java.exe"
For OS X use /Applications/jAlbum.app/Contents/MacOS/jAlbum

Issue java -jar JAlbum.jar -? in the same directory as the jAlbum application is installed in and jAlbum will list all allowed parameters. Select Tools->Open directories->"Program directory" to find the right directory.

Here is a list of the currently allowed parameters and their defaults:

 
-acceleratedScaling true
-accountProfileName 
-albumAddress 
-albumHeight 420
-albumWidth 560
-baseDirectory 
-classicReaders false
-closeupDirectory slides
-closeupPrefix 
-cols 6
-connected false
-copyOriginals true
-cpuCores 4
-creator 
-creditText credit1
-currentProject 
-customImageOrdering 
-dateFormat 
-directoriesFirst true
-directory 
-directoryChaining NO_CHAINING
-disableColorSubsampling false
-displayVersion 24
-excludeBacklinks false
-excludeByDefault false
-exifImageDescription false
-exifUserComment false
-fileNamer 
-forceJPEGImages false
-forceJPEGThumbs false
-forceProcessing false
-ftpForceUTF8 false
-ftpPassword 
-ftpPort 21
-ftpServer 
-ftpUser 
-generateJSON false
-hiDPIImages false
-hiDPIThumbs false
-highQualityThumbs true
-homepageAddress 
-homepageLinkText 
-ignorePattern \..*
-imageBackgroundColor #ffffff
-imageLinking LinkScaled
-imageOrdering OrderByDate
-imageSize 640x480
-imageVariants []
-includeDirectories true
-includePattern 
-indexPageName index
-internalVersion 24.0.4
-iptcCaption true
-jpegComment false
-keepMetaData false
-keepXmpData true
-makeThumbs true
-mediaRSS true
-metaData true
-myjalbum false
-notes 
-notifyNotes true
-outputDirectory album
-outputFormat JPEG
-overrideExistingCopyright false
-pageExtension .html
-pageNamer 
-passiveMode true
-programDirectory /Applications/jAlbum.app/Contents/app
-projectFile 
-protocol ftp
-qualityPercent 85
-qualityPercentWebP 60
-readXmp true
-remoteDirectory VALUE_UNSET
-remoteFS info.cqs.remotefs.RemoteFSBean@74751b3
-resourceDirectory res
-reverseOrder false
-rights 
-rightsURL 
-rows 4
-runTool 
-scalingMethod ScaleSmooth
-searchEngineFriendlyNames false
-sharpenPercent 25
-skin Tiger
-skinsDirectory /Applications/jAlbum.app/Contents/app/skins
-slideDirectory slides
-slides true
-smartUpload 
-smoothScalingType STANDARD
-style Linen.css
-subdirs true
-superimposeFilmIcon true
-textEncoding UTF-8
-textFileComment true
-themeImageProcessor 
-themeImageSize 
-thumbnailDirectory thumbs
-thumbnailPrefix 
-thumbSize 124x124
-thumbVariants []
-titleSource IPTCObjectName
-updatedDirsOnly false
-uploadAll 
-urlEncode true
-useCustomVideoSettings false
-user.<your variable> <value>
-useThumbForFolderIcon true
-videoParameters -y=,-i=$inputPath,-vf=hqdn3d\=1.5:1.5:6:6\,scale\=min(iw\\\,trunc(iw*min($videoWidth/iw\\\,$videoHeight/ih)*0.5)*2):min(ih\\\,trunc(ih*min($videoWidth/iw\\\,$videoHeight/ih)*0.5)*2)\,unsharp\=3:3:1.0:3:3:0.0\,$normalizeOrientation,-ss=$clipStart,-t=$clipLength,-threads=0,-b:a=96k,-ac=2,-ar=44100,-vcodec=libx264,-crf=$videoQuality,-metadata:s:v:0=rotate\=0,-movflags=faststart,-pix_fmt=yuv420p,$outputPath=
-videoQuality 50
-videoResolution p720
-visibleOnProfilePage true
-webPassword 
-webSafeNames true
-widgetInjection true
-writeUTF8 true

Required arguments are -directory and (-outputDirectory or -sameDirectory).


User defined variables are passed as -user.yourVariable "Value". Similar applies to skin defined variables (having a -skin. prefix). Command line mode is great for automated album generation and updates. Webmasters can make scripts that call the jAlbum application regularly to update server albums etc.

Variables and their parameters are case sensitive, so remember to write -projectFile, not -projectfile or -ProjectFile for instance.


Passing parameters is accomplished by using the -D switch before the -jar parameter, for example

java -Duser.language=en -jar JAlbum.jar

You can see what parameters can be used by looking in the list of properties in the help/about menu

Examples

Note, in the following examples the commands are shown on separate lines for clarity and readability on smaller screens, the commands must actually be entered as a single command line.


Here is an example that updates an album out of files in D:\Nature and grabs other settings from the nature.jap project file. The -Xmx400M flag allows jAlbum to grab up to 4000MB of RAM if the default amount is not enough.

java -Xmx4000M -jar JAlbum.jar 
-directory D:\Nature 
-sameDirectory 
-projectFile nature.jap 


Here's another example that uploads the same project to a web server (v6). Note to ‘make and upload’ the album you first need to ‘make it’, as in the example above, and then run the command again with -smartUpload appended:

java -jar JAlbum.jar 
-directory D:\Nature 
-sameDirectory 
-projectFile nature.jap 
-smartUpload


Here is an example that makes jAlbum enter "server mode" by running the "Server mode" Tool. When in "server mode", jAlbum monitors changes under the image directory. As soon as a change is detected (new image added for instance) a "Make album" operation is triggered. jAlbum then resumes to monitor the image directory.

java -Xmx400M -jar JAlbum.jar 
-projectFile nature.jap 
-runTool "tools/Server mode.bsh"


Here is finally how to launch jAlbum in windowed mode from a command line and having it load a project:

java -Xmx400M -jar JAlbum.jar 
jalbum-settings.jap"

Linux/UNIX users: To run jAlbum from the command line in a plain server system (with no access to the X windowing system) add the -Djava.awt.headless=true command line switch.