The Thumbnail Generator will help you overcome the limitations on thumbnails creation imposed by Liferay. It allows you to create an unlimited number of thumbnails in a totally customized way.
Requirements :
You need to install the ImageMagick library. Go to
http://www.imagemagick.org/script/download.php ,">
http://www.imagemagick.org/script/download.php , select an executable depending on your operating system and follow the wizard.
On Unix, you can also install it by package manager, ex: apt-get install imagemagick.
Configuration :
Before using the Thumbnail Generator, you have to configure it. Go to Menu -> Control Panel -> Configuration -> System Settings -> Thumbnail Configuration. Add at least one file type (ex: jpg) and one command line (ex: img_480:convert -resize 480×270 ) and save the configuration.
Note : on Windows, the 'convert' command may execute a program other than ImageMagick. To call the right command, replace 'convert' by 'magick', (ex: img_480:magick -resize 480×270 )
You are now ready to use the Thumbnail Generator !
Add an image in your application and try to get the thumbnail that was automatically generated by adding the parameter 'thumb=img_480' in the URL of the image. (ex:
http://localhost:8080/documents/20147/0/test.jpg/0d72d709-3e48-24b3-3fe6-e39a3c528725?version=1.0&t=1494431839298&imagePreview=1&thumb=img_480) Le Thumbnail Generator vous aidera à dépasser les limitations en matière de création de thumbnails imposées par Liferay. Il vous permettra de générer un nombre illimité de thumbnails pour chacune de vos images de manière totalement personnalisable.
Pré-requis :
Vous devez installer la librairie ImageMagick. Téléchargez un executable sur
http://www.imagemagick.org/script/download.php
selon votre système d'exploitation and suivez les instructions de l'installateur automatique.
Sur un système UNIX, vous pouvez aussi utiliser un gestionnaire de paquets; ex: apt-get install imagemagick
Configuration :
Avant de pouvoir utiliser le Thumbnail Generator, vous devez le configurer. Allez dans Menu -> Control Panel -> Configuration -> System Settings -> Thumbnail Configuration. Ajoutez au moins un File type (ex: jpg) et une Command line (ex: img_480:convert -resize 480×270 ) puis sauvez la configuration.
Note : sur Windows, la commande 'convert' peut faire référence à un autre programme que ImageMagick. Pour appeller la bonne commande, remplacez 'convert' par 'magick', (ex: img_480:magick -resize 480×270 )
Vous êtes maintenant prêt à utiliser le Thumbnail Generator !
Ajoutez une image dans votre application et essayer de récupérer le thumbnail généré automatiquement en ajoutant le paramètre 'thumb=img_480' dans l'URL de l'image. (ex:
http://localhost:8080/documents/20147/0/test.jpg/0d72d709-3e48-24b3-3fe6-e39a3c528725?version=1.0&t=1494431839298&imagePreview=1&thumb=img_4800