version 1.5, 2004/11/18 20:15:09
|
version 1.6, 2004/12/06 10:02:54
|
Line 24 use MPIWGlib;
|
Line 24 use MPIWGlib;
|
|
|
$| = 1; # unblock IO |
$| = 1; # unblock IO |
|
|
my $version = "V0.9.3 (ROC 18.11.2004)"; |
my $version = "V0.9.4 (ROC 6.12.2004)"; |
|
|
$debug = 0; |
$debug = 0; |
|
|
Line 41 my $overwrite = 0; # overwrite already c
|
Line 41 my $overwrite = 0; # overwrite already c
|
|
|
# image file extensions and formats |
# image file extensions and formats |
my %img_type_ext = ("tif" => "TIFF", "tiff" => "TIFF", "gif" => "GIF", |
my %img_type_ext = ("tif" => "TIFF", "tiff" => "TIFF", "gif" => "GIF", |
"jpg" => "JPEG", "png" => "PNG"); |
"jpg" => "JPEG", "png" => "PNG", "dcr" => "RAW"); |
# destination image file extensions |
# destination image file extensions |
my %target_ext_type = ("TIFF" => "jpg", "JPEG" => "jpg"); |
my %target_ext_type = ("TIFF" => "jpg", "JPEG" => "jpg"); |
|
|
Line 637 sub convert_file {
|
Line 637 sub convert_file {
|
# |
# |
$pictype = quickident("$srcdir/$filename"); |
$pictype = quickident("$srcdir/$filename"); |
if ($pictype) { |
if ($pictype) { |
|
if ($pictype eq "RAW") { |
|
logger('DEBUG', "skipping raw file '$srcdir/$filename'"); |
|
return 0; |
|
} |
my $newext = $target_ext_type{$pictype}; |
my $newext = $target_ext_type{$pictype}; |
if ($newext) { |
if ($newext) { |
$newfn = $filebase . ".$newext"; |
$newfn = $filebase . ".$newext"; |
Line 653 sub convert_file {
|
Line 657 sub convert_file {
|
} |
} |
} else { |
} else { |
# quick ident failed -- do it slowly |
# quick ident failed -- do it slowly |
|
|
($pictype, $picwidth, $picheight, $bitdepth) = identify("$srcdir/$filename"); |
($pictype, $picwidth, $picheight, $bitdepth) = identify("$srcdir/$filename"); |
if ((! $pictype)||($picwidth == 0)||($picheight == 0)) { |
if ((! $pictype)||($picwidth == 0)||($picheight == 0)) { |
logger('WARNING', "unknown file type '$srcdir/$filename'"); |
logger('WARNING', "unknown file type '$srcdir/$filename'"); |