r155 - 30 Jun 2008 - 14:31:29 - MagicYangYou are here: TWiki >  Plugins Web > ImageGalleryPlugin > ImageGalleryPluginDev
Tags:
images 1 Add my vote for this tag, , create new tag

ImageGalleryPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on ImageGalleryPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below
• See ImageGalleryPluginDevArchive for older discussions.

Feedback on ImageGalleryPlugin

Current problems:

  • looping endless while interfacing newer versions of image::magick; this bug may affect other plugins too that make use of this perl module
  • usability issues; make this plugin more flexible arranging galleries; maybe a smarter image gallery application can be written using the ImagePlugin
  • caching issues with multiple galleries on the same topic; thumbnails not updated correctly

-- MichaelDaum - 16 Jun 2006

Please consider adding the use strict; pragma to this plugin. Its use is important to ensuring the quality of TWiki plugins and avoiding unpleasant surprises. See UseStrict for more.

-- MeredithLesly - 02 Jul 2006

It looks like ImageGalleryPlugin doesn't work with Topics that have underscores on them

-- JoaoChrist - 11 Jul 2006

When I update an attachment, it doesn't seem to update the preview in the gallery. The thumbnail will update when I clear my cache, but the larger preview (when you're looking through one at a time) doesn't seem to. Has anyone else encountered this?

-- CristosLianidesChin - 30 Nov 2006

To resolve my problem (30 Nov 2006), I found the "refresh=on" parameter in the ImageGalleryPlugin docs. To force an update any time attachments are loaded, I modified line 240 of /lib/TWiki/UI/Upload.pm as follows:

$session->redirect( $session->getScriptUrl( 1, 'view', $webName, $topic, 'refresh','on' ));

-- CristosLianidesChin - 04 Dec 2006

It seems that modifying Upload.pm is not enough; the image size is recalculated, but a new thumbnail is not generated. This is fast getting over my head, so I added a 'refresh image' link.

Inserted at line 379 of /lib/TWiki/Plugins/ImagegalleryPlugin/Core.pm:

  #refresh
  $result .= "<tr><td class=\"igpNavigation\">"
   . "<a href=\"$viewUrl?id=$this->{id}&filename=$filename&refresh=on#igp$this->{id}\">"
   . "refresh image"
   . "</a>" 
   . "</td></tr>";

-- CristosLianidesChin - 04 Dec 2006

Just updated this plugin for the first time in quite a while. It's greatly improved, so thanks to everyone that worked on it!

One problem, though. It seems to get confused if a filename has more than one dot in it. For example, an image file called dec05party_10.psd.jpgcopy.jpg doesn't seem to get recognized as an image so it doesn't show up in the gallery.

-- TobyCabot - 24 Dec 2006

I had a bit of a struggle to get ImageGalleryPlugin working on my Suse 10.0. all because of the interface with ImageMagick? . Eventually I used ImageMagick? 6.2.3 as provided with Suse 10.0 installation and I had to install the corresponding version of PerlMagick? manually . To do that I downloaded the source for ImageMagick? 6.2.3 and did only the PerlMagick installation. Using CPAN console won't work for me since they have 6.29 on CPAN.

-- StephaneLenclud - 07 Jan 2007

Personally, I like Imager better. It's a lot easier to install. All I need is libjpeg, libgif, and libpng. I tried installing ImageMagick? on a web server running Fedora Core 2, and I got nothing but grief as ImageMagick? kept looking for X11 libraries on a web server that has no monitor for X windows. Why ImageMagick? needs X11 libraries is beyond me. I tried downloading Fedora Core 2 rpms, but Core 2 is no longer supported, and the one site where I luckily found Core 2 rpms has X11 libraries that are unrecognizable by ImageMagick? . I would update from Core 2 to Core 6, but this is a Core 2 configured dedicated server, and I have some months left on the contract before I switch over to another servier. I got an idea. I think I'll write some code that identifies whether Imager or ImageMagick? is installed and use whichever one is installed. That way I can use Imager.

-- LambertLum - 07 Jan 2007

Is it possible to change the behaviour of the thumbnails (e.g. the ones in UserListByPhotograph? ) so that they link to the personal user topic?

I had few tries already but nothing worked...

see LinkImageGalleryThumbnailsToTopicX

-- CarloSchulz - 08 Feb 2007

If you're running on a memory-constrained machine you might find that the thumbnailing process bails out (for me it was usually trying to write the thumbnail file) with an Insufficient memory (case 4) error. In that case you can add a line $this->{mage}->Set('memory-limit'=>8); around line 766, i.e. in the createImg function just before the image is written.

-- TobyCabot - 23 Feb 2007

Trying this with 4.1.2 gave the following error in the warn file:

Can't create file /home/httpd/twiki/pub/TWiki/ImageGalleryPlugin/_igp1/info.txt - No such file or directory
 at /home/httpd/twiki/lib/TWiki/Func.pm line 1997 

Manually creating the _igp1 dir seems to solve the problem?

-- SteffenPoulsen - 17 Apr 2007

I had nearly the same error message as Steffen after upgrading to 4.1.2. and it disappered after manually creating the _igp1 dir as well.

-- CarloSchulz - 24 Apr 2007

I found the documentation on size slightly confusing. It looked like I need to write x100px to get an image of 100px high, but in fact I need to write x100.

-- ArthurClemens - 11 Jun 2007

Using the extension installer through configure on 4.1.2, I get the following error:

Fetching http://twiki.org/p/pub/Plugins/ImageGalleryPlugin/ImageGalleryPlugin.tgz...
Warning: I can't install http://twiki.org/p/pub/Plugins/ImageGalleryPlugin/ImageGalleryPlugin.tgz because I don't recognise the download as a gzip file.
Warning: Extension may not have been packaged correctly. Trying for a .zip file instead.

Fetching http://twiki.org/p/pub/Plugins/ImageGalleryPlugin/ImageGalleryPlugin.zip...
Unpacking...
ImageGalleryPlugin_installer
...snip...
pub/TWiki/ImageGalleryPlugin/
pub/TWiki/ImageGalleryPlugin/style.css
Error: Failed to move file 'lib/TWiki/Plugins/ImageGalleryPlugin/' to /home/httpd/twiki/lib/TWiki/Plugins/ImageGalleryPlugin: Is a directory
Software error:
Installation terminated at /home/httpd/twiki/lib/TWiki/Configure/UIs/EXTEND.pm line 149.

-- ChrisPurves - 11 Jul 2007

Chris, have a look at ConfigureDoesNotRecognizePluginFiles. Maybe this solves your issue...

-- CarloSchulz - 12 Jul 2007

Bug I think ?
When using the following line in an included topic it seems to present the 
images ok but produced url's are to the included topic instead of the including 
topic which is not where the images are.
%IMAGEGALLERY{ "%INCLUDINGTOPIC%" columns="4"  thumbtitle="$comment"  }%
-- HaroldDrip - 19 Nov 2007

It would be nice if there was some sort of debugging built into this plugin. It's not working for me, getting "no images found", even though they are there, with nothing in the error log. I can go through and put in debugging statements manually, but still would be nice if it were there already.

-- MichelleHedstrom - 29 Jan 2008

If your images aren't recognized as being of type image, then you have a problems with the mime types of your installation. Please check your $TWiki::cfg{MimeTypesFileName}. Does this file exist? Can TWiki read it? Are the relevant image/... entries in there?

-- MichaelDaum - 30 Jan 2008

The file exists. Twiki can definitely read it (and just to double check, I set the permissions on the file to 777), and the relevant image/ entries are in there.

-- MichelleHedstrom - 06 Feb 2008

I got it to work. Whoever (not me!) had set up our twiki had neglected to set DataDir? in the TWiki.cfg file, so it was looking for the mimetypes file in / instead of in the data directory.

-- MichelleHedstrom - 06 Feb 2008

I installed ImageGalleryPlugin on my twiki but images didn't appear (see screenshot below) when I wrote:

%IMAGEGALLERY{"Main.WebHome" columns="6" sort="name"}%
There are %NRIMAGES{"Main.WebHome"}% images at Main.

  • ImageGalleryFail.gif
  • ImageGalleryFail2.gif
Did anyone encounter this kind of situation before? It's weird that my another twiki installation works but I really don't know why! BTW, I didn't install CPAN Image:Magick in both environments. Does it really a MUST for ImageGalleryPlugin?

-- MagicYang - 01 Apr 2008

Check the url the img tags point to and make sure your web server will deliver the images from that path. You will definitely need CPAN:Image::Magick.

Btw: the new upcoming version will allow you to select Graphics::Magick as an alternative image processing backend as some versions of Image::Magick have problems in an environment running TWiki in a perl accelerator like mod_perl or speedy-cgi. Graphics::Magick - a fork of Image::Magick - does not have this problem, is faster (not perceivable, but hey) and more actively maintained.

-- MichaelDaum - 01 Apr 2008

Here is some more information of my env.:

  1. The thumb images are generated automatically in the path like: /twiki/pub/images/Main/TestTopic/1/thumb_bsid.gif
  2. When I directly use this URL in the browser, it complained: Attachment 'thumb_bsid.gif' does not exist
  3. When I click the thumb and get into single picture, the url path is like: /twiki/pub/images/Main/TestTopic/1/bsid.gif (The file is copied automatically)
  4. When I directly use this URL in the browser, it complained: Attachment 'bsid.gif' does not exist

Wired and why? BTW, when will the next version come out?

-- MagicYang - 02 Apr 2008

I got the problem! It's because that I added following setting in my twiki.conf to protect attachments in the /pub directory!

Alias /twiki/pub/ "/userap/users/teamspace/twiki/pub"
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/+twiki/+pub/+TWiki/+.+
RewriteRule ^/+twiki/+pub/+([^/]+)/+((([^/]+)/+)+)(.+) /twiki/bin/viewfile/$1/$4?filename=$5 [L,PT]
BUT, I added the same setting to my another environment and it didn't cause any problem in finding images in /pub/images/... Still wired!!

-- MagicYang - 03 Apr 2008

I made the plugin PDF aware, since Imagemagick (with support of ghostscript) supports this format for years now. Added the patch to this topic. May I commit my change into svn?

(Sorry for the noisy diff.)

-- OliverKrueger - 12 May 2008

Hello Michael, I find that the ImageGalleryPlugin will break if the filename of the image contains a period.

That is:

  • filename = image_2008.06.11 will break
  • filename = image_2008_06_11 will be OK

-- KeithHelfrich - 11 Jun 2008

Got the error. It is in lib/TWiki/Plugins/ImageGalleryPlugin/Core.pm in the method isImage(). The regular expression parsing in the suffix should grab the shortest string after the dot in the filename:

Change this:

  my $suffix = '';
  if ($attachment->{name} =~ /\.(.+)$/) {
    $suffix = lc($1);
  }

to this:

  my $suffix = '';
  if ($attachment->{name} =~ /\.(.+?)$/) {
    $suffix = lc($1);
  }

Note the additional ? char in the regular expression. Not tested yet, but I am pretty sure this will work out. Gonna create a new release.

-- MichaelDaum - 12 Jun 2008

Hi Michael, I've replaced that code block and still get Error: no images found in a test topic when the only image attached has periods in the file name.

Could you confirm that's the fix on your end, because I don't think that is it ? Thanks!

-- KeithHelfrich - 14 Jun 2008

Hi Michael, i'm using this Plugin in a TWikiApp to work as a web file mananger. I found some bugs and i correct then:

  • When including a topic with the %IMAGEGALLERY%:
    • the album navegator is not rendered
    • all links for the original files are wrong
  • The "no images found" is not cool every time... We must be able to change the error text or disable the error, so i created the noimages parameter. The noimages receive any string to show when no images found. The default value is "no images found" and you can disable this error with the value "off".
  • SVG is important! The ImageMagick is not good enought with that, so i created the listsvg parameter to enable/disable the SVG listing.
  • To show the SVG for the user i make that to render previews in PNG.

Patch with some corrections for the Core.pm published at 13 Nov 2007.

-- AurelioAHeckert - 25 Jun 2008

Hi Michael,
Suggest to add below remark in the document:
If you use mod_rewrite to protect your attach files:

  • RewriteCond? %{REQUEST_URI} !^/+twiki/+pub/+TWiki/+.+
  • RewriteRule? ^/+twiki/+pub/+([^/]+)/+((([^/]+)/+)+)(.+) /twiki/bin/viewfile/$1/$4?filename=$5 [L,PT]
It will convert /twiki/pub/Web/Topic to /twiki/bin/viewfile/Web/Topic?filename..., and copied images in /pub/iamges will be convert to an invalid path that cause ImageGalleryPlugin failing to find the file.

Please add another rewrite condition like:

  • RewriteCond? %{REQUEST_URI} !^/+twiki/+pub/+images/+.+
to exclude ImageGalleryPlugin cache files.

-- MagicYang - 30 Jun 2008

 
Topic attachments
I Attachment Action Size Date Who Comment
elsepatch Core.pm.PDF.patch manage 11.7 K 12 May 2008 - 00:05 OliverKrueger Patch to add PDF support
elsediff Core.pm.diff manage 7.0 K 25 Jun 2008 - 20:59 AurelioAHeckert Patch with some corrections for the Core.pm published at 13 Nov 2007
elsepatch cygwin.patch manage 2.1 K 31 Jul 2003 - 17:56 MattWilkie add $IDENTIFY, chg 'path' to 'name'
jsjs gallery.js manage 0.9 K 28 Oct 2004 - 13:47 MartinCleaver  
elsecss meadows.css manage 4.4 K 28 Oct 2004 - 13:51 MartinCleaver  
txttxt philipmeadows21.txt manage 4.9 K 29 Oct 2004 - 08:40 MartinCleaver  
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r155 < r154 < r153 < r152 < r151 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo