mason/.perl-lib/TrivGal.pm: Make cache directories world-unreadable.
[tgal] / mason / .perl-lib / TrivGal.pm
index e329e00..e97ffb6 100644 (file)
@@ -148,6 +148,8 @@ export qw{%SIZE};
 our %SIZE = (smallthumb => 96,
             medthumb => 144,
             bigthumb => 228,
+            small => 480,
+            embed => 720,
             view => 1200);
 
 export qw{init};
@@ -258,9 +260,9 @@ package TrivGal::Image {
     $scaled->image_set_format($ty->imlibfmt);
     $scaled->set_quality(90);
     my $new = "$TMP/t$$-$ext";
-    make_path $TMP;
+    make_path $TMP, { mode => 0771 };
     $scaled->save($new);
-    make_path $dir;
+    make_path $dir, { mode => 0771 };
     rename $new, $thumb;
     return $thumburl;
   }
@@ -303,12 +305,14 @@ sub listdir ($) {
        $comment = defined $comment ? $comment . "\n" . $_ : $_;
       } else {
        if ($item && $comment) { $item->comment($comment); }
-       my ($indexp, $name, $c) =
-         /^ (! \s+)?                   # index flag
+       my ($flags, $name, $c) =
+         /^ (?: ([-!]+) \s+)?          # flags
             (\S+) \s*                  # filename
             (\S | \S.*\S )?            # start of the comment
             \s*
             $/x;
+       my $indexp = $flags =~ /!/;
+       my $hidep = $flags =~ /-/;
        $name = urldecode $name;
        my $list;
        $item = TrivGal::Item->new($name);
@@ -325,7 +329,7 @@ sub listdir ($) {
          }
        }
        $comment = $c;
-       push @$list, $item;
+       push @$list, $item unless $hidep;
       }
     }
     if ($item && $comment) { $item->comment($comment); }