From: Steinar H. Gunderson Date: Sun, 25 Jan 2009 20:03:24 +0000 (+0100) Subject: Treat CR2 the same as NEF. X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=4c67de43660ea5ee7077ab8c2c6b787471901a71 Treat CR2 the same as NEF. --- diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index 9f9a72f..00fa9e9 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -497,7 +497,7 @@ sub read_original_image { # ImageMagick can handle NEF files, but it does it by calling dcraw as a delegate. # The delegate support is rather broken and causes very odd stuff to happen when # more than one thread does this at the same time. Thus, we simply do it ourselves. - if ($filename =~ /\.nef$/i) { + if ($filename =~ /\.(nef|cr2)$/i) { # this would suffice if ImageMagick gets to fix their handling # $physical_fname = "NEF:$physical_fname"; diff --git a/perl/Sesse/pr0n/Index.pm b/perl/Sesse/pr0n/Index.pm index 3597dee..ee0e311 100644 --- a/perl/Sesse/pr0n/Index.pm +++ b/perl/Sesse/pr0n/Index.pm @@ -77,7 +77,7 @@ sub handler { } # Any NEF files => default to processing - my $ref = $dbh->selectrow_hashref("SELECT * FROM images WHERE vhost=? $where AND LOWER(filename) LIKE '%.nef' LIMIT 1", + my $ref = $dbh->selectrow_hashref("SELECT * FROM images WHERE vhost=? $where AND ( LOWER(filename) LIKE '%.nef' OR LOWER(filename) LIKE '%.cr2' ) LIMIT 1", undef, $r->get_server_name) and $defsettings{'xres'} = $defsettings{'yres'} = undef;