[misc] Add early support for importing with Darktable.

This commit is contained in:
Solomon Peachy 2015-07-25 10:39:48 -04:00
parent 383bc0f6bd
commit 89b8108d08
3 changed files with 81 additions and 10 deletions

19
CHANGES
View File

@ -8,9 +8,9 @@ For further information about Photo Organizer, see its web site at:
v2.38 (Unreleased)
[misc] Get rid of "IE7" compatibility library.
[misc] Get rid of "IE7" compatibility library
[themes] Use CSS3 to style radio buttons and checkboxes
[themes] Use CSS3 drop-shadows for images.
[themes] Use CSS3 drop-shadows for images
[themes] Use CSS styling for menus instead of the graphics hack
[themes] Convert the action buttons to using spans instead of tables
[misc] Update to tagcloud v3
@ -20,17 +20,18 @@ v2.38 (Unreleased)
[misc] Added systemd unit file for background workers
[fix] Newer versions of memcached had issues with our code
[fix] Script errors when adding/editing equipment
[fix] Fix a couple of straggling warnings.
[fix] Fix a couple of straggling warnings
[misc] Add a script to verify repository checksums
[fix] Bulk update was broken due to earlier theme changes.
[fix] Fix URL on the profile location pages.
[misc] Installer now checks for the 'mbstring' extension.
[add] Added support for JPEG-XR, WebP, and MJPEG/MJPEG-2000 formats.
[fix] Bulk update was broken due to earlier theme changes
[fix] Fix URL on the profile location pages
[misc] Installer now checks for the 'mbstring' extension
[add] Added support for JPEG-XR, WebP, and MJPEG/MJPEG-2000 formats
[add] Beginnings of a JSON-RPC implementation
[add] Remove some of the roadblocks from serving non-JPEG images.
[add] Remove some of the roadblocks from serving non-JPEG images
[misc] Fix handling of if-modified-since header when serving images
[misc] Use the database's stored file size and timestamps
[misc] Use '©' instead of '(c)' for default copyright stuff.
[misc] Use '©' instead of '(c)' for default copyright stuff
[misc] Early support for using darktable to import RAWs
v2.37.1 (December 3, 2012)

View File

@ -111,11 +111,15 @@ $sys_exiftool = "/usr/bin/exiftool";
$sys_ufraw = "/usr/local/bin/ufraw-batch";
/* Raw decoders, in order of prescedence */
$raw_decoder = "dcraw,ufraw,exiftool";
$raw_decoder = "dcraw,ufraw,darktable,exiftool";
// dcm2pnm tool from the dcmtk suite
$sys_dcm2pnm = "/usr/local/dicom/bin/dcm2pnm";
// Darktable RAW decoder
$sys_darktable = "/usr/local/bin/darktable-cli";
// PS2PDF - converts PS documents into PDF ones
$sys_ps2pdf = "/usr/bin/ps2pdf";

View File

@ -1024,6 +1024,70 @@ function import_decode_dcm2pnm($input_file_name, $camera_input_profile, &$image_
}
}
function import_decode_darktable($input_file_name, $camera_input_profile, &$image_data, $index, &$output) {
global $sys_darktable;
global $tmp_volume_path;
global $strings;
$po_options = $image_data['po_options'];
$temporary_file_name = tempnam($tmp_volume_path, "po");
unlink($temporary_file_name);
$temporary_file_name = $temporary_file_name . ".ppm";
if (!is_executable($sys_darktable))
return FALSE;
$output .= "<li>".sprintf($strings['import_decoding_raw_using'], 'darktable')." ... ";
/* Default to highest quality, and sRGB colorspace output */
$options = " -hq 1 ";
// if ($po_options['dcraw_brightness'] != 1) {
// $options .= " -b $po_options[dcraw_brightness]";
// }
// if ($po_options['raw_denoise'] > 0) {
// $options .= " -n $po_options[raw_denoise]";
// }
// switch ($po_options['raw_white_balance']) {
// case "automatic":
// $options .= " -a";
// break;
// case "camera":
// $options .= " -w";
// break;
// }
if ($po_options['raw_bitdepth'] == 48) {
$options .= " --bpp 16";
} else {
$options .= " --bpp 8";
}
// if ($camera_input_profile != FALSE) {
// if ($camera_input_profile == "") $camera_input_profile = "embed";
// $options = $options . " -p $camera_input_profile";
// }
$cmdline = "$sys_darktable " . escapeshellarg($input_file_name) . " $temporary_file_name $options ";
system($cmdline, $retval_decoding);
if ($retval_decoding) {
$output .= "<font color=\"red\">".$strings['generic_failed'].".</font></li>\n";
$output .= "<li><pre>$cmdline</pre></li>\n";
return FALSE;
} else {
/* dcraw automatically rotates images */
$image_data['file'][$index]["orientation"] = "Normal (O deg)";
$output .= $strings['generic_done'].".</li>\n";
return $temporary_file_name;
}
}
function import_decode($input_file_name, $decoder, $camera_input_profile, &$image_data, $index, &$output) {
global $icc_profiles;
@ -1051,6 +1115,8 @@ function import_decode($input_file_name, $decoder, $camera_input_profile, &$imag
$res = import_decode_exiftool($input_file_name, $camera_input_profile, $image_data, $index, $output);
} else if ($decoder == "ufraw") {
$res = import_decode_ufraw($input_file_name, $camera_input_profile, $image_data, $index, $output);
} else if ($decoder == "darktable") {
$res = import_decode_darktable($input_file_name, $camera_input_profile, $image_data, $index, $output);
} else if ($decoder == "dcm2pnm") {
$res = import_decode_dcm2pnm($input_file_name, $camera_input_profile, $image_data, $index, $output);
} else if ($decoder == "gimp") {