This question about Configuration: Answered

ThumbnailPlugin: keep working after installation

Can get ThumbnailPlugin working

  • Foswiki 1.0.9 installation from the USB stick *Used on Windows XP Pro and Windows 7 Pro - german versions
  • Installed plugin from within Configure | Extensions - Installation says OK
  • Enabled Plugin in Configure

  • Is included in the list of installed plugins: *ThumbnailPlugin (ThumbnailPlugin 1.1.1, $Rev: 15942 (11 Aug 2008) $): Maintains thumbnails of attachments

  • These files can be found in the corresponding directories:
    • data/System/ThumbnailPlugin.txt Plugin topic
    • data/System/ThumbnailPlugin.txt,v Plugin topic repository
    • lib/Foswiki/Plugins/ThumbnailPlugin.pm Plugin Perl module
    • tools/attachutil Attachment utility

What about GD and Image::MetaData::JPEG libraries from CPAN.

How must they be installed - and where?

No action on the screen:

lines like %ATTACHMENT{"foo.jpg" label="%IMG{"%THUMBNAIL{"foo.jpg"}%" align="left" }%"}%

or %THUMBNAIL{ name="filename" variant="size" }% show no effect.

Can you show a page using ThumbnailPlugin that I can take my inspiration....?

in my sandbox is an short example:

Error: (3) can't find help.jpg in Support Error: (3) can't find Penguins.jpg in Support

<-- the two images are shown -->

%THUMBVIEW{"Penguins.jpg"}% %ATTACHMENT{"penguins.jpg" label="%IMG{"%THUMBNAIL{"penguins.jpg"}%" align="left" }%"}% %THUMBNAIL{ name="penguins.jpg" variant="100" }%

<-- the three lines show in he screen: --> %ATTACHMENT{"penguins.jpg" label="%IMG{"penguins_thumbnail_150.jpg" align="left" }%"}% penguins_thumbnail_100.jpg

And now?

-- ChaMar - 09 Mar 2010

I've never used ThumbnailPlugin myself but I can try to point you in the right direction regarding the installation of CPAN modules. The best/easiest way of installing these modules depends on the server setup you're running (OS & Perl version). If you're on a Debian flavoured system, you can do the following:
# aptitude install libgd-gd2-perl libimage-metadata-jpeg-perl
Other Linux distributions have their own packaging system which should work in a similar manner but you would have to find out the exact naming of the packages.

On any Linux you can also use cpan to install modules:
# cpan (if this doesn't work, type: perl -MCPAN -e shell
cpan> install GD
cpan> install Image::MetaData::JPEG
Let us know if this solves your problem.

-- MartinKaufmann - 10 Mar 2010

Thx, Martin,

as indicated in he first lines of my question, I am working on Windows, no Linux OS. We should wait for anybody with FOSWIKI / Windows experience.

-- ChaMar - 10 Mar 2010

Sorry, I only noticed you're running Foswiki on Windows on re-reading your report. So on Windows, it should work like this:
i:\perl\bin> .\ppm
PPM> install GD
PPM> install Image::MetaData::JPEG

Afterwards, you have to enable the plugin on a per-topic, web, or site basis using the THUMBNAILPLUGIN_ENABLE preference variable.

For all attachments that are uploaded after enabling the plugin thumbnails should be generated automatically (check the corresponding pub/YourWeb/YourTopic directory for files like image_thumbnail_150.png). By typing %THUMBVIEW{ name="image.png" }% you should get a thumbnail displayed in your topic.

-- MartinKaufmann - 10 Mar 2010

I will inform you here, when it is working. Thank you.

-- ChaMar - 11 Mar 2010

Installation of GD and Image::MetaData::JPEG installed. [ I do not know what happened, but when I tried it a second time it said:

Version 2.44 of 'GD' is already installed.
Version 0.153 of 'Image-MetaData-JPEG' is already installed. ]

In my Sandbox - Webpreferences I added [ http://localhost/foswiki/bin/view/Sandbox/WebPreferences ] Set THUMBNAILPLUGIN_ENABLE = on

I then stopped FOSWIKI, restarted, attached a new jpg file [ Penguins4.jpg ], and a thumbnail appeared in pub/sandbox/testThumNail

Penguins4.jpg
Penguins4_thumbnail_150.jpg

Penguins4.jpg is displayed [ Penguins.jpg ] but no thumbnails:

  • %THUMBNAIL{name="Penguins4.jpg" variant="100"}%
  • %THUMBNAIL{name="Penguins4.jpg" variant="200"}%
  • %THUMBNAIL{name="Penguins4.jpg" variant="150"}%

in source show

* Penguins4_thumbnail_100.jpg
* Penguins4_thumbnail_200.jpg
* Penguins4_thumbnail_150.jpg

but no picture.

%THUMBVIEW{"Penguins4.jpg" }% shows the thumbview, probably 150 pixel large, it is the selected default.

shows same thumbview in raw view here is a line of code...

Last clue missing ... Please

-- ChaMar - 13 Mar 2010

So what exactly is your problem? If I understand your report correctly, %THUMBVIEW% generates a thumbnail and %THUMBNAIL% returns the name of the thumbnail file. That's exactly what this plugin is supposed to do (see plugin description). What sort of output do you expect?

-- MartinKaufmann - 15 Mar 2010

My problem was that It only shows the text Penguins4_thumbnail_100.jpg and not the picture. But I will use the %THUMBVIEW{"Penguins.jpg"}% which is enough for my test.

I am just testing how to get rid of the black bars over and under the thumbnail picture. 150 seems to be 150 pixel width and 150 pixel hight. I close the question now. Thank you for the help.

-- ChaMar - 15 Mar 2010

Yes, that's what %THUMBNAIL% does (from plugin description):
Given an image file name, returns the name of its thumbnail file of the given size. [...] Used with the AttachLinkPlugin and ImgPlugin, it becomes easy to do things like display hyperlinks to images as thumbnails of that image. Examples below. But if that's what you want, use %THUMBVIEW instead.

I haven't seen any black bars in my setup.

-- MartinKaufmann - 15 Mar 2010

Black bars [ in thumbnails ]can be seen with .jpg pictures , but NOT with .png pictures, and he size ratio is correct with .png, NOT with .jpg format.

-- ChaMar - 15 Mar 2010

AFAIK ThumbnailPlugin only generates square thumbnail. In case of jpg files, thr bars required to generate a square thumbnail are black. In case of png files, there are also bars on each side (or top/bottom) but they are transparent (png supports transparency, jpg doesn't).

Looking at the code of ThumbnailPlugin, it shouldn't bee too hard to include support for non-square thumbnails.

-- MartinKaufmann - 16 Mar 2010

QuestionForm edit

Subject Configuration
Extension ThumbnailPlugin
Version Foswiki 1.0.9
Status Answered
Topic revision: r12 - 16 Mar 2010, MartinKaufmann - This page was cached on 09 Jan 2018 - 07:41.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License