[import/exif] ExifTool can decode the 'Flash Model' too!

This commit is contained in:
Solomon Peachy 2008-12-21 17:27:14 -05:00
parent 71a53b2b5b
commit 836ddd88e7
2 changed files with 8 additions and 4 deletions

View File

@ -73,6 +73,7 @@ For further information about Photo Organizer, see its web site at:
[fix] We weren't using the original watermark image sometimes. [#388]
[fix] A miscalculation on the pretty-printing of lat/long values.
[misc] Be smarter in how we link to Google Maps.
[add] Where possible, automatically detect the flash type used.
2.36 (August 17, 2008)

View File

@ -147,12 +147,12 @@ function convert_exif_camera($database, $user_id, &$image_data, $camera_make, $c
return FALSE;
}
function convert_exif_lens($database, $user_id, &$image_data, $lens_id) {
function convert_exif_equipment($database, $user_id, &$image_data, $lens_id, $type) {
$lens_id = pg_escape_string($lens_id);
$lens = pg_query($database, "select identifier from view_equipment
where model = '$lens_id'
and type = ".PO_EQUIPMENT_LENS ."
and type = $type
and users = $user_id");
if (!$lens)
@ -160,7 +160,7 @@ function convert_exif_lens($database, $user_id, &$image_data, $lens_id) {
if (pg_num_rows($lens) > 0) {
$my_lens = pg_fetch_row($lens, 0);
$image_data['equipment'][] = "$my_lens[0]:".PO_EQUIPMENT_LENS;
$image_data['equipment'][] = "$my_lens[0]:$type";
return TRUE;
}
@ -283,7 +283,10 @@ function photo_parse_exif($database, $index, $user_id, $image_data) {
$image_data["shutter"] = convert_exif_shutter($database, $value);
break;
case "Lens ID":
convert_exif_lens($database, $user_id, $image_data, $value);
convert_exif_equipment($database, $user_id, $image_data, $value, PO_EQUIPMENT_LENS);
break;
case "Flash Model":
convert_exif_equipment($database, $user_id, $image_data, $value, PO_EQUIPmENT_FLASH);
break;
case "GPS Version ID":
// "normal" is 2.2.0.0