How to improve the performance of Rosetta thumbnail creation?
- Product: Rosetta
- Product Version: 7.x - 8.1
- Relevant for Installation Type: Local
Question
How to improve performance of Rosetta Thumbnail generation ?
Answer
- Verify that "Transformation Profile" Output Parameters option is selected for all "Thumbnail Task Rules" (under Rosetta Administration module).
"Stream Handler" Output Parameter option is available in Rosetta UI, however it is deprecated feature and not suggested to be used with Rosetta 4.0 or newer versions.
For more information please refer to: https://developers.exlibrisgroup.com/blog/creating-a-migration-tool-split-plug-in/ - Out-of-the-box "JPG Thumbnails" Transformation Profile can be used to generate a JPEG thumbnail from prevalent formats (image, video, PDF, etc),
it is configured to use "JPG-JPGMigrationTool" bundled Plugin, which uses ImageMagic utility (a 3rd party component deployed with Rosetta).To retrieve a list of file formats supported by ImageMagic, SSH to a Rosetta Application server as 'dps' Linux user and run: convert -list format
Additional file format notes and/or limitations are listed in ImageMagic official site.
To optimize "JPG-JPGMigrationTool" Plugin:- SSH to any Application server as 'dps' Linux user and run:
cd $op_dir/plugins/bundled/bin/JPG-JPGMigrationTool-Vr-1.2/binwhich should deploy the optimized "$op_dir/plugins/bundled/bin/JPG-JPGMigrationTool-Vr-1.2/bin/run_jpg_deriv_copy.sh" script with MD5 checksum: ccf360e4bf2ac7498251bb5458d51299
cp -p run_jpg_deriv_copy.sh run_jpg_deriv_copy.sh.orig.SP`grep -iPo 'app.version=\K.*' $dps_system/conf/global.properties`-`date +'%Y%m%d'`
echo 'H4sICPnTW2UCA3J1bl9qcGdfZGVyaXZfY29weS5zaAC9VdFu00oQffdXTLcWiQWOkz42Ta8KlN5egYjaIIGaqNrYG2dhvWt212kLrcRH8AV8Gl/C7NqJg6CI+1JLltc7O2fmzBmPd3eSOZfJnJplsPtAFwaCf9UVWAWpkgueV5rBmTLMWtoxMNFUmoXSBbVcSRhrteCCwT/O7fuXbzDxbiumLVAwXOZoLGnOElPNY17gCtQCikpYHvv9eqmZUaLykEZVOmXgYJ8AhsWVNhbGVNOCWaYNXHG7BLtsgLdcZVXMmYYul5blTEc9l5W/WC/fbyj53JQUN21ev0Lsucj7EO+teR3JG1hUGqNq9GtSAW6ASjh1tF7RnKeIXxRUZrHgkrXnzBOXQA9iwz8xuIX4Y8WR2C0wm/Z6vQfV9rzKc2Ysy+6REjUmba3Jvi/A1691GSdLLI+kXBiszWDNI06VUNqUFGU7O3kKrp6O6KDfv8Z7jfCcab7CWCsGz1R5s+/8ihLPGvhvfHzi0Kjg9gb9/gTpMfsPV7NgF/iiaUIuy8o6XQsnfdMr8SFkCqRCg1apo8PdSZDs2oJQqgzQ/wJI+HmQJPEdgZh93Hqbwd5hkrFVIishhq6vJfDR3hCYMAxXgyEGxySuNC2BCgFzTMF1v6DGbveihLmm6QdmTYCqQreLziEfhvwg3B265eMBRFGQqcBLeXl0djIiU0xkh99NCfG7uHc+IqF7gDeQ9rAz1Auon7Xt5dF5g9U4ZEqyvylauqQSxwHx9kvXexKpEPeZkgO/Ga83Dy8OGj+1RnV4hzPy/2vbcAm7LF0qWDO6xQ8+g45JSJhcdMJut8GIB1HUmZGkE3kZXr+ZjN9MLp+fnm3oFh8yjnxKF7Y1Y/Ct0Gu/F6cvj0c/n8OAXRzwnqaDWJfzjkSk977MiWtAmmWt5FTnVcGkDVoJt+Cdkj+puGUjwX1CBmxFxWY6Ntbg1bvjt6eTUein+5/1xKG3cV/ggMBido2ltjKwM+pHdendNP9V2v6MeHddyfbfkVMuvbb3i/vokXupc3RGnLh9mP1Ocq80GddfJ/6TNi2E87/+J3GJI5Fmrr1a7aOIDO9tl5Jpgaoz1zPTi2n2eIpd4rj4VvldOYewqafvpYBd46DYMAiCH+a3qy3vBwAA' | base64 -d -i - | gzip -d - > run_jpg_deriv_copy.sh
dos2unix run_jpg_deriv_copy.sh
chmod +x run_jpg_deriv_copy.sh - Update the relevant Transformation Profile (e.g. "JPG Thumbnails"), add a numerical switch (i.e. the File's inner page number) at the start of the "Parameters" field's value.
For example:
Assuming the current Transformation Profile "Parameters" field is defined with: -quiet -colorspace RGB -resize 100x100
Assuming we want to create a thumbnail from the 1st page/image/frame of a File, we should change it to: -1 -quiet -colorspace RGB -resize 100x100The above suggested optimized script should allow existing Transformation Profiles to work as they did before.
Adding additional numerical switch to the beginning of the "Parameters" field's value is only required to enable the above mentioned optimization. - [Optional] To test the above suggested optimized thumbnail creation script, we should clean the relevant thumbnail cache of the relevant IE/s for the Files we're testing (otherwise Rosetta would continue to retrieve it from cache, i.e. it will not recreate it using the optimized script).
To workaround that, run either "Clean Operational Thumbnails" or "Create Operational Thumbnails" (with "Replace existing thumbnail" option set to "yes") out-of-the-box Task-Chains on the relevant IE/s, then Deliver the thumbnail for the relevant File/s.
- SSH to any Application server as 'dps' Linux user and run:
- Further optimizations may be reached by further tweaking the Transformation Profile "Parameters" field (i.e. command-line options) that the relevant 3rd party utilities is using.
For example, in case of out-of-the-box "JPG-JPGMigrationTool" Plugin, "ImageMagic"* 3rd party utility is used.
* Please refer to ImageMagic official website for more information on ImageMagic command-line options:
https://imagemagick.org/script/command-line-options.php
- Out-of-the-box "JP2 Thumbnails" Transformation Profile can be used to generate a JPEG thumbnail from a JPEG2000 file format, it is configured to use "JP2-JPGMigrationTool" bundled Plugin, which uses both OpenJPEG and ImageMagic utilities (a 3rd party components deployed with Rosetta).
"JP2-JPGMigrationTool" Plugin version 1.3 "run_j2kdriver_thmb.sh" script's efficiency can be optimized (by using "reduce factor" option of OpenJPEG) to allow faster creation of intermediate PNG file that the plugin creates before it converts the latter to the final JPEG thumbnail.
To optimize "JP2-JPGMigrationTool" Plugin:- SSH to any Application server as 'dps' Linux user and run:
cd $op_dir/plugins/bundled/bin/JP2-JPGMigrationTool-Vr-1.3/binwhich should deploy the optimized "$op_dir/plugins/bundled/bin/JP2-JPGMigrationTool-Vr-1.3/bin/run_j2kdriver_thmb.sh" script with MD5 checksum: 7817b04447b4b09a465135b7944ca565
cp -p run_j2kdriver_thmb.sh run_j2kdriver_thmb.sh.orig.SP`grep -iPo 'app.version=\K.*' $dps_system/conf/global.properties`-`date +'%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Q6q5TUPaUntPKoqKUNN1BCJZNLsWo1q9sw/Kvuw81VUKcvzpGXktNVaazDi6i9qaxGF/VotQ8PV3S4XmfXzaB4V6G5abVs0ncWLx5YvKgXF+5yO0apsGA1Wpn8jew0DN2Q16c+wgp0XWXX/GKACKvEmmHLrii37LZ2P9hZ7aedb9qDgo7DHuLs9gec/LFPHlTKQ3pKPGo0ON1jKMLHQXGZHTh89Fg7QhUJYnmsjkuFNCxwJ0tCPlsWwove1Cj95cUQDv6vFb7KQOGlBF1W7aHppU0yfD/AtSrUmFOewoS95eGav015P9xzrmpsP07V4BUmCuAl+peVZOnrKEn5oIde5dbou6vD81299vS2Q6xTK/SORY17Ey6ZuPubUoXRg1Jp0gVdKTND/DjR6SsPuBol0Hl0wmrp3JF3L5a1voM1SQp4cEYepQu+hq0AtZtlrOIPbdBhTFCge8RCtBWLjXV/HppPtC8PxK/7VxXd+9znE/hZ7BY5w+/DwNxucDbLVQK2XTvWdHEte7UZx/kfF/OTM+QVAAA=' | base64 -d -i - | gzip -d - > run_j2kdriver_thmb.sh
dos2unix run_j2kdriver_thmb.sh
chmod +x run_j2kdriver_thmb.sh - Update the relevant Transformation Profile (e.g. "JP2 Thumbnails"):
Suggested "Parameters": -thumb -quiet -colorspace RGB -resize 100x100- To resize output, pass: -<resize|thumbnail|scale|adaptive-resize|sample|resample> <x_resolution>x<y_resolution>
e.g.: -resize 150x150 - To create thumbnail, pass (only as first parameter): -t / -tmb / -thumb / -thumbnail
e.g.: -thumb
Note: "-resize 100x100" is passed by default in case none of above mentioned 'resize' parameters aren't passed.
Also, OpenJPEG "reduce factor" is used, its highest possible value is calculated by the script to produce intermediate image that should be larger (pixel wise) than the final ImageMagic resized image.
This is done to considerably reduce overall time it takes to create a thumbnail. - To control OpenJPEG "reduce factor" value, pass (only as first parameter): -<number>
e.g.: -2
Note: Default value is 0, i.e. nothing is discarded, which typically causes intermediate image output creation to take a long time. - To control OpenJPEG intermidiate output image format, pass (as first parameter): -<tif|TIF>
e.g.: -tif
Note: Default format is PNG, its size on storage is much smaller than TIF format output, but it's slower to create.
Using TIF format can speed up creation of Derivative Copy Files, assuming enough available storage space (for Thumbnail creation - the affect on the output generation speed is minor, but the storage footprint is notable).
- To resize output, pass: -<resize|thumbnail|scale|adaptive-resize|sample|resample> <x_resolution>x<y_resolution>
- [Optional] To test the above suggested optimized thumbnail creation script, we should clean the relevant thumbnail cache of the relevant IE/s for the Files we're testing (otherwise Rosetta would continue to retrieve it from cache, i.e. it will not recreate it using the optimized script).
To workaround that, run either "Clean Operational Thumbnails" or "Create Operational Thumbnails" (with "Replace existing thumbnail" option set to "yes") out-of-the-box Task-Chains on the relevant IE/s, then Deliver the thumbnail for the relevant File/s.
- SSH to any Application server as 'dps' Linux user and run:
- Article last edited: 17-09-2024