X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=gal2%2FUCW%2FGallery.pm;h=f0a1e97ccb01cd11f69f94793d4cf481ab6d084a;hb=1f16a38e970000b2c73a59a84182b5f90ee5cb61;hp=847de01987b3b1f226424ed13e483743111ff5cf;hpb=b89f977dc5a5d785766118992aa90a7eff7b5d3b;p=gallery.git diff --git a/gal2/UCW/Gallery.pm b/gal2/UCW/Gallery.pm index 847de01..f0a1e97 100644 --- a/gal2/UCW/Gallery.pm +++ b/gal2/UCW/Gallery.pm @@ -20,9 +20,9 @@ BEGIN { } our %CF; -our $th; BEGIN { + # FIXME: Check config $CF{'Title'} = 'An Unnamed Gallery', $CF{'HeadExtras'} = "", $CF{'TopExtras'} = "", @@ -36,6 +36,7 @@ BEGIN { $CF{'ThumbUrlPrefix'} = "", $CF{'MetaDataDir'} = '.', $CF{'PhotoDir'} = '.', + # FIXME: Who sets GalDir? $CF{'ScanDefaultTransform'} = 's'; $CF{'OrigDir'} = '.'; @@ -43,8 +44,7 @@ BEGIN { $CF{'CacheDir'} = 'cache', $CF{'PhotoMaxWidth'} = 1024, $CF{'PhotoMaxHeight'} = 1024, - # FIXME: ThumbSizes should be set by themes - $CF{'ThumbSizes'} = [ [114,94], [256,256] ], + $CF{'ThumbFormats'} = {}, } sub LoadConfig() { @@ -66,11 +66,17 @@ sub SetOptions(@) { $CF{$o} = $v; if ($o eq "Theme") { require $CF{"GalDir"} . "/$v/theme.pm"; - Gallery::Theme::Init($CF{"GalURL"} . "/$v"); + UCW::Gallery::Theme::Init($CF{"GalURL"} . "/$v"); } } } +sub RequireThumbnails($$) { + my ($w, $h) = @_; + my $fmt = "${w}x${h}"; + $CF{'ThumbFormats'}->{$fmt} = 1; +} + sub WriteList($$) { my ($file, $images) = @_; open LIST, '>', "$file.new" or die "Cannot create $file.new: $!\n";