[import] Try to look up cameras based on their serial number first.
This commit is contained in:
parent
ec2657fc6e
commit
59e70234ea
1
CHANGES
1
CHANGES
|
@ -19,6 +19,7 @@ For further information about Photo Organizer, see its web site at:
|
|||
[fix] Better handle non-UTF8-encoded image metadata [#423]
|
||||
[fix] Auto-importing embedded RAW previews as the 'master' works. [#421]
|
||||
[fix] Use proper random filenames when generating "print" files. [#305]
|
||||
[misc] Try to look up cameras based on serial number first.
|
||||
|
||||
2.37-rc2 (October 13, 2009)
|
||||
|
||||
|
|
|
@ -124,9 +124,21 @@ function convert_exif_iso($database, $iso) {
|
|||
return $row[0];
|
||||
}
|
||||
|
||||
function convert_exif_camera($database, $user_id, &$image_data, $camera_make, $camera_model) {
|
||||
|
||||
$camera = pg_query($database, "
|
||||
function convert_exif_camera($database, $user_id, &$image_data, $camera_make, $camera_model, $serialno) {
|
||||
|
||||
/* Try a serial number lookup first */
|
||||
if ($serialno) {
|
||||
$camera = pg_query($database, "
|
||||
select camera.identifier, camera_type.raw_icc_profile, camera.ignore_comment
|
||||
from camera, camera_type
|
||||
where camera.serial_number = '$serialno'
|
||||
and camera_type.identifier = camera.type
|
||||
and camera.users = $user_id");
|
||||
}
|
||||
|
||||
/* If that fails, look it up based on make/model */
|
||||
if (!$camera) {
|
||||
$camera = pg_query($database, "
|
||||
select camera.identifier, camera_type.raw_icc_profile, camera.ignore_comment
|
||||
from camera, camera_type, manufacturer
|
||||
where '$camera_make' ILIKE '%'||manufacturer.name||'%'
|
||||
|
@ -229,8 +241,9 @@ function photo_parse_exif_orientation_colorspace($database, $index, $user_id, $i
|
|||
}
|
||||
|
||||
if (isset($exif_data["Camera Model Name"]) ||
|
||||
isset($exif_data["Make"])) {
|
||||
convert_exif_camera($database, $user_id, $image_data, $exif_data["Make"], $exif_data["Camera Model Name"]);
|
||||
isset($exif_data["Make"]) ||
|
||||
isset($exif_data["Serial Number"])) {
|
||||
convert_exif_camera($database, $user_id, $image_data, $exif_data["Make"], $exif_data["Camera Model Name"], $exif_data["Serial Number"]);
|
||||
}
|
||||
|
||||
return $image_data;
|
||||
|
|
Loading…
Reference in New Issue