Running jAlbum from the command line

Revision as of 31 July 2021 21:35 by RobM (Comments | Contribs) | (Examples)

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
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/

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
-albumHeight 420
-albumWidth 560
-classicReaders false
-closeupDirectory slides
-cols 6
-connected false
-copyOriginals true
-cpuCores 4
-creditText credit1
-directoriesFirst true
-directoryChaining NO_CHAINING
-disableColorSubsampling false
-displayVersion 24
-excludeBacklinks false
-excludeByDefault false
-exifImageDescription false
-exifUserComment false
-forceJPEGImages false
-forceJPEGThumbs false
-forceProcessing false
-ftpForceUTF8 false
-ftpPort 21
-generateJSON false
-hiDPIImages false
-hiDPIThumbs false
-highQualityThumbs true
-ignorePattern \..*
-imageBackgroundColor #ffffff
-imageLinking LinkScaled
-imageOrdering OrderByDate
-imageSize 640x480
-imageVariants []
-includeDirectories true
-indexPageName index
-internalVersion 24.0.4
-iptcCaption true
-jpegComment false
-keepMetaData false
-keepXmpData true
-makeThumbs true
-mediaRSS true
-metaData true
-myjalbum false
-notifyNotes true
-outputDirectory album
-outputFormat JPEG
-overrideExistingCopyright false
-pageExtension .html
-passiveMode true
-programDirectory /Applications/
-protocol ftp
-qualityPercent 85
-qualityPercentWebP 60
-readXmp true
-remoteDirectory VALUE_UNSET
-remoteFS info.cqs.remotefs.RemoteFSBean@74751b3
-resourceDirectory res
-reverseOrder false
-rows 4
-scalingMethod ScaleSmooth
-searchEngineFriendlyNames false
-sharpenPercent 25
-skin Tiger
-skinsDirectory /Applications/
-slideDirectory slides
-slides true
-smoothScalingType STANDARD
-style Linen.css
-subdirs true
-superimposeFilmIcon true
-textEncoding UTF-8
-textFileComment true
-thumbnailDirectory thumbs
-thumbSize 124x124
-thumbVariants []
-titleSource IPTCObjectName
-updatedDirsOnly false
-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
-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


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 
-projectFile nature.jap 

On a Mac it would be something like this (on one line

-directory /Users/userName/My\ Albums/ProjectName 
-sameDirectory jalbum-settings.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 
-projectFile nature.jap 

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 

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.