[mb-commits] branch, master, updated. MBS-4115, support .png in contrib/ssssss.psgi.

MusicBrainz Git Server <[email protected]> Mon, 31 Dec 2012 16:36:20 +0000
Newsgroups gmane.comp.audio.musicbrainz.cvs
Message-ID <E1TpiLb-0003fY-Nj@wiley>
The branch, master has been updated
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=d45b07d3f6b9a00b20d23e693b98ba28b8dc54dc (commit)
      from  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=b19943e311da0f50aae70b2aafbfb61700db697c (commit)

Summary of changes:
 contrib/ssssss.psgi |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d45b07d3f6b9a00b20d23e693b98ba28b8dc54dc
Author: warp <[email protected]>
Date:   Mon Dec 31 17:34:56 2012 +0100

    MBS-4115, support .png in contrib/ssssss.psgi.

diff --git a/contrib/ssssss.psgi b/contrib/ssssss.psgi
index 4257f73..e086c9e 100644
--- a/contrib/ssssss.psgi
+++ b/contrib/ssssss.psgi
@@ -41,6 +41,7 @@ use Plack::Response;
 use Log::Dispatch;
 
 my $log = Log::Dispatch->new(outputs => [[ 'Screen', min_level => 'info' ]] );
+my $imgext = 'jpg|png';
 
 sub catfile { return File::Spec->catfile (@_); }
 
@@ -49,7 +50,7 @@ sub thumb
     my ($filename, $max) = @_;
 
     my $newfile = $filename;
-    $newfile =~ s/.jpg$/_thumb$max.jpg/;
+    $newfile =~ s/.($imgext)$/_thumb$max.$1/;
 
     $log->info ("Generating ${max}x${max} thumbnail, $newfile\n");
 
@@ -103,7 +104,7 @@ sub handle_post
 
     move ($request->uploads->{file}->path, $dest);
 
-    if ($key =~ /.jpg$/)
+    if ($key =~ /.($imgext)$/)
     {
         thumb (catfile ($bucketdir, $key), 250);
         thumb (catfile ($bucketdir, $key), 500);

-----------------------------------------------------------------------


hooks/post-receive
-- 
mb_server