]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Update to r10 of the gallery plugin, as per <http://ned.snow-crash.org:8080/svn/ikiwi... gallery
authorThomas Schwinge <tschwinge@gnu.org>
Tue, 30 Oct 2007 23:14:55 +0000 (00:14 +0100)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 6 Nov 2007 20:34:48 +0000 (15:34 -0500)
CHANGELOG.gallery
IkiWiki/Plugin/gallery.pm
README.gallery

index 8fce836b6942da65de2655810d61a9e68eff39c1..0a2c920ac16bec35a257997ef74a9a51703fcd5e 100644 (file)
@@ -1,5 +1,8 @@
 Project IkiWiki::gallery.pm 
 ===========================
+resize = "0" option included if no resize is intended. (use this if you face any problems with underlaydirs)
+----
+
 Version 0.9
 Support for resizing of images also included.
 Additional options : 
index b18dbaa73fff7d1b96204149cf3319ce03912aba..4e4a8420c357a1b481ce9a87cc6f96d2999656f3 100644 (file)
@@ -143,7 +143,12 @@ sub makeGallery (@) {#{{{
        my $vcs = $params{vcs} ;  
        my $sort = $params{sort}; 
        my $exif = $params{exif} || 1;  
-       my $resize = $params{resize} || '800x600' ;  
+       my $resize = $params{resize} || '800x600' ; 
+  my $to_resize =1; 
+  if (defined $params{resize} and $params{resize} == "0" ) { 
+    $to_resize=0; 
+  } 
+
        $vcs = 1 if not defined $vcs;
 
        my $dir = bestdir($params{page}, $imagedir,$vcs) || return "[[gallery ".sprintf(gettext("Directory %s not found"), $imagedir)."]]"; 
@@ -186,7 +191,9 @@ sub makeGallery (@) {#{{{
                $imageoutlink = "$config{destdir}/$dir/${iw}x${ih}-$imagefile"; #Every image may not have this.
                
                will_render($params{page}, $thumblink); 
-               will_render($params{page}, $resizedimagelink); 
+    if($to_resize == 1 ) { 
+               will_render($params{page}, $resizedimagelink); 
+    }  
                
                if (-e $thumboutlink && -e $imageoutlink && (-M sourcefile($imagelink,$vcs) >= -M $thumboutlink) && (-M sourcefile($imagelink,$vcs) >= -M $imageoutlink)) {
                        $r = $im->Read($thumboutlink);
@@ -200,6 +207,7 @@ sub makeGallery (@) {#{{{
 
                        my($imwidth,$imheight) = $im->Get('columns','rows');
                        my @blob;
+      if($to_resize == 1 ) {
                        if($imwidth > $iw || $imheight > $ih) {         
                                my $temp1 = $imagelink ; 
                                $imagelink = "$dir/${iw}x${ih}-$imagefile"; 
@@ -213,6 +221,7 @@ sub makeGallery (@) {#{{{
                                                $imagelink= $temp1;
                                }
                        }
+      }
 
                        $r = $im->Resize(geometry => "${w}x${h}"); #Create Thumbnail
                        return "[[gallery ".sprintf(gettext("Failed to resize: %s"), $r)."]]" if $r;
index f8cb8857b9ec1c735369b928b172e1b5d411ee08..2b39f7fb45725646daa9ade1d7fd12cd90f0510b 100644 (file)
@@ -15,7 +15,7 @@ Plugin can be used as
 Available options :
 - imagedir(required) => Directory containing images. It will scan all the files with jpg|png|gif extension from the directory and will put it in the gallery.
 - thumbnailsize(optional,Default=200x200) => Size of the thumbnail that you want to generate for the gallery.
-- resize(optional, Default=>800x600) => Width and Height to resize image to.
+- resize(optional, Default=>800x600) => Width and Height to resize image to or resize="0" for no resize
 - alt(optional) => If image can not be displayed, it will display the text contained in alt argument.
 - cols(optional,Default=3) => Number of columns of thumbnails that you want to generate.
 - rows(optional, Default=>3) => Number of Rows on a gallery page.