Goobi workflow
Documentation homeGoobi workflow PluginsGoobi workflow Digests
English
English
  • Overview
    • Goobi workflow Handbook
    • Overview of documentation
    • What is Goobi?
  • Users
    • Goobi for Users
    • The basics
      • Logging in
      • Menu
      • Logging out
      • Switch between available languages
      • Help function
      • Personal settings
      • Changing your password
      • My tasks
      • Processes
      • How to find a process
      • How to create a new process
      • Edit task details
    • How different user groups work with Goobi
      • Scanning
      • Quality control
      • Manual script steps and plugin steps
      • Automatic script-run steps
      • Metadata processing
      • Export to the DMS
    • Metadata Editor
      • User interface
        • Structure tree
        • Page display
        • Menu options
      • Metadata indexing
        • Pagination
        • Structuring
          • Create new structure element
          • Moving structure elements
          • Copying structure elements from other processes
      • Modifying and verifying data
        • Subsequent changes to pagination
        • Uploading files
        • Downloading files
        • Server-based exports
        • Server-based imports
      • Edit OCR results
      • Overview of the keyboard combinations
  • Management
    • Goobi Management
    • Structure of the extended user interface
    • Rulesets
    • LDAP groups
    • Users
    • User groups
    • Processes
      • Searching processes
      • Activity
      • Activities for hit lists
      • GoobiScript
    • Variables
    • Harvester
  • Administration
    • Goobi Administration
    • File system
      • Global directory structure
        • ‘config’ sub-directory
        • ‘import’ sub-directory
        • ‘metadata’ sub-directory
        • ‘plugins’ sub-directory
        • ‘rulesets’ sub-directory
        • ‘scripts’ sub-directory
        • ‘xslt’ sub-directory
      • Directory structure of the application
      • Integrating external storage
      • Integration of S3 as storage
    • Services
      • MySQL database
      • Apache Tomcat servlet container
      • User authentication using LDAP
      • File system access using Samba
    • Exporting to digital libraries
      • Technical data
      • Mets parameters
      • Mets file groups
      • Export configuration in the Goobi configuration file
    • Working with the intranda Task Manager
    • Automatic workflow steps
      • Example combination for an automatic script task
      • Migration of technical data to METS files
      • Automatic image deletion
    • Configuration files
      • goobi_activemq.xml
      • goobi_config.properties
      • goobi_digitalCollections.xml
      • goobi_exportXml.xml
      • goobi_mail.xml
      • goobi_metadataDisplayRules.xml
      • goobi_normdata.xml
      • goobi_opac.xml
      • goobi_opacUmlaut.txt
      • goobi_processProperties.xml
      • goobi_projects.xml
      • goobi_rest.xml
      • goobi_webapi.xml
      • messages_xx.properties
      • config_contentServer.xml
    • Installation guide
      • Installation guide - Ubuntu 20.04
    • Update guide
      • Preparation of an update
      • Update steps
        • 2020
        • 2021
        • 2022
        • 2023
        • 2024
        • 2025
    • Authentication options
      • Authentication via the database
      • Authentication via HTTP header
      • Authentication via OpenID Connect
    • Use cases
      • Create thumbnails for accelerated image display
      • Handling of 3D Objects
      • Export of 3D-Objects into the Goobi viewer
  • Developer
    • Setting up a development environment
      • Preparatory work
      • Setting up Eclipse
      • Resetting the data
      • Best practice for developing Goobi and working with Eclipse
    • Using the REST API
    • Snippets for the development on Goobi workflow
      • HTML
      • JavaScript
Bereitgestellt von GitBook
Auf dieser Seite
  • The thumbs folder
  • Example configuration
Als PDF exportieren
  1. Administration
  2. Use cases

Create thumbnails for accelerated image display

For some time now, it has been possible to create a thumbs/ folder in Goobi workflow process folders. In this folder, thumbnails for the images in the folders in the images/ folder can be stored. When doing this, you must follow a naming convention that is evaluated by Goobi workflow and used to display images efficiently.

The thumbs folder

A folder below the thumbs/ folder may only contain jpg images and must follow the following naming scheme to be used by Goobi:

<images-folder-name>_<size-of-longest-side-in-pixels>

For example, if you now have the following folder in the images/ folder:

images/myexampleprocess_master

For thumbnails with a maximum page length of 1000 pixels you would have to create the following folder in the thumbs/ folder and fill it with matching images:

thumbs/myexampleprocess_master_1000

Example configuration

The folders and images in them can be created using a script step in Goobi workflow. The script step may contain multiple scripts to create thumbnails in multiple sizes. The following scripts create thumbnails for the master images in 800, 1600 and 3200 pixel sizes:

/bin/bash /opt/digiverso/goobi/scripts/gm-convert.sh -s {origpath} -d {processpath}/thumbs/master_{processtitle}_media_800 -D .jpg -o "-thumbnail 800x800"
/bin/bash /opt/digiverso/goobi/scripts/gm-convert.sh -s {origpath} -d {processpath}/thumbs/master_{processtitle}_media_1600 -D .jpg -o "-thumbnail 1600x1600"
/bin/bash /opt/digiverso/goobi/scripts/gm-convert.sh -s {origpath} -d {processpath}/thumbs/master_{processtitle}_media_3200 -D .jpg -o "-thumbnail 3200x3200"

For the derivatives, the calls are made in the same way:

/bin/bash /opt/digiverso/goobi/scripts/gm-convert.sh -s {tifpath} -d {processpath}/thumbs/{processtitle}_media_800 -D .jpg -o "-thumbnail 800x800"
/bin/bash /opt/digiverso/goobi/scripts/gm-convert.sh -s {tifpath} -d {processpath}/thumbs/{processtitle}_media_1600 -D .jpg -o "-thumbnail 1600x1600"
/bin/bash /opt/digiverso/goobi/scripts/gm-convert.sh -s {tifpath} -d {processpath}/thumbs/{processtitle}_media_3200 -D .jpg -o "-thumbnail 3200x3200"

The script gm-convert.sh used here can be downloaded here and should be placed in the folder /opt/digiverso/goobi/scripts/:

gm-convert.sh
#!/bin/bash

PATH=${PATH}:/usr/local/bin

set -e
set -u

USAGE="
$0 - wrapper script for GraphicsMagick's convert command.

Mandatory options:
    -s SOURCEDIR            Source folder with images to convert
    -d DESTDIR              Output folder
    -D DEST_EXTENSION       Output file extension

Other options:
    -S SOURCE_EXTENSION     Only convert source files with these extensions
    -o GMOPTION [ -o ... ]  GM Options

    Calling from Goobi - example script command (be careful with spaces within \"\"):
    /path/to/$(basename $0) \"-s{origpath}\" \"-d{tifpath}\" \"-D.tif\" \"-o+matte -depth 8 -compress JPEG\"
"


## check if the called tools exists
type -P gm &>/dev/null || { echo "ERROR: GraphicsMagick is required but seems not to be installed." >&2; exit 1; }


## check for the given arguments
[ "$#" -ge "3" ] || { echo "$USAGE"; exit 1; }    # at least
SOURCE_EXTENSION=".*"                             # if none specified use .* as source file type
GMOPTIONS=""                                      # if none specified use none
while getopts "s:d:S:D:o:"  OPCOES; do
  case $OPCOES in
    s ) SOURCEDIR="$OPTARG";;
    d ) DESTDIR="$OPTARG";;
    S ) SOURCE_EXTENSION="$OPTARG";;
    D ) DEST_EXTENSION="$OPTARG";;
    o ) GMOPTIONS="$GMOPTIONS $OPTARG";;
    ? ) echo "$USAGE"; exit 1;;
    esac
done

# check arguments
[ -d "${SOURCEDIR}" ] || { echo "ERROR: Input folder ${SOURCEDIR} does not exist." >&2; exit 1; }
[ -d "${DESTDIR}" ]   || mkdir -p "${DESTDIR}" || { echo "ERROR: Could not create destination folder ${DESTDIR}." >&2; exit 1; }
stat -t "${SOURCEDIR}/"*${SOURCE_EXTENSION} >/dev/null || { echo "ERROR: No *${SOURCE_EXTENSION} input files found in ${SOURCEDIR}" >&2; exit 1; }


# convert
cd "${SOURCEDIR}"
CTR=0
for i in *${SOURCE_EXTENSION}; do
  CTR=$((CTR+1))
  nice gm convert "$i" ${GMOPTIONS} "${DESTDIR}/${i%${SOURCE_EXTENSION}}${DEST_EXTENSION}" || { echo "ERROR: GM command failed: gm convert $i ${GMOPTIONS} ${DESTDIR}/${i%${SOURCE_EXTENSION}}${DEST_EXTENSION}" >&2; exit 1; }
done


# Success
echo "
Done converting $CTR images to $DEST_EXTENSION with GraphicsMagick.
Options used:          $GMOPTIONS
Source directory:      $SOURCEDIR
Destination directory: $DESTDIR
"

exit 0

# Notizen
# nice gm mogrify -depth 8 +matte -compress JPEG "${i}"
# if [ "$(tiffinfo ${i} 2>&1 | grep Bits | awk {'print $2'})" != "1" ]; then
# prepare !
VorherigeUse casesNächsteHandling of 3D Objects

Zuletzt aktualisiert vor 5 Monaten