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 :
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)."]]";
$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);
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";
$imagelink= $temp1;
}
}
+ }
$r = $im->Resize(geometry => "${w}x${h}"); #Create Thumbnail
return "[[gallery ".sprintf(gettext("Failed to resize: %s"), $r)."]]" if $r;
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.