@@ -557,6 +557,7 @@ local PLACEHOLDERS = {"ROLL.NAME",
557557 " MONTH.SHORT" ,
558558 " DAY" ,
559559 " HOUR" ,
560+ " HOUR.AMPM" , -- Not Implemented
560561 " MINUTE" ,
561562 " SECOND" ,
562563 " MSEC" ,
@@ -567,6 +568,7 @@ local PLACEHOLDERS = {"ROLL.NAME",
567568 " EXIF.MONTH.SHORT" ,
568569 " EXIF.DAY" ,
569570 " EXIF.HOUR" ,
571+ " EXIF.HOUR.AMPM" , -- Not Implemented
570572 " EXIF.MINUTE" ,
571573 " EXIF.SECOND" ,
572574 " EXIF.MSEC" ,
@@ -575,12 +577,23 @@ local PLACEHOLDERS = {"ROLL.NAME",
575577 " EXIF.ISO" ,
576578 " EXIF.EXPOSURE" ,
577579 " EXIF.EXPOSURE.BIAS" ,
580+ " EXIF.EXPOSURE.PROGRAM" , -- Not Implemented
578581 " EXIF.APERTURE" ,
579582 " EXIF.CROP.FACTOR" ,
580583 " EXIF.FOCAL.LENGTH" ,
581584 " EXIF.FOCAL.LENGTH.EQUIV" , -- Not Implemented
582585 " EXIF.FOCUS.DISTANCE" ,
583- " IMAGE.EXIF" , -- Not Implemented
586+ " EXIF.MAKER" ,
587+ " EXIF.MODEL" ,
588+ " EXIF.WHTIEBALANCE" , -- Not Implemented
589+ " EXIF.METERING" , -- Not Implemented
590+ " EXIF.LENS" ,
591+ " EXIF.FLASH.ICON" , -- Not Implemented
592+ " EXIF.FLASH" , -- Not Implemented
593+ " GPS.LONGITUDE" , -- Not Implemented
594+ " GPS.LATITUDE" , -- Not Implemented
595+ " GPS.ELEVATION" , -- Not Implemented
596+ " GPS.LOCATION.ICON" , -- Not Implemented
584597 " LONGITUDE" ,
585598 " LATITUDE" ,
586599 " ELEVATION" ,
@@ -589,9 +602,6 @@ local PLACEHOLDERS = {"ROLL.NAME",
589602 " RATING.ICONS" , -- Not Implemented
590603 " LABELS" ,
591604 " LABELS.ICONS" , -- Not Implemented
592- " EXIF.MAKER" ,
593- " EXIF.MODEL" ,
594- " EXIF.LENS" ,
595605 " TITLE" ,
596606 " DESCRIPTION" ,
597607 " CREATOR" ,
692702
693703-- build the argument substitution list from each image
694704
695- function dtutils_string .build_substitution_list (image , sequence , variable_string , username , pic_folder , home , desktop )
705+ function dtutils_string .build_substitute_list (image , sequence , variable_string , username , pic_folder , home , desktop )
696706 local old_log_level = log .log_level ()
697707 log .log_level (dtutils_string .log_level )
698708
@@ -703,6 +713,8 @@ function dtutils_string.build_substitution_list(image, sequence, variable_string
703713 is_api_9_1 = false
704714 end
705715
716+ local is_api_9_4 = dt .configuration .api_version_string >= " 9.4.0" and true or false
717+
706718 local datetime = os.date (" *t" )
707719 local long_month = os.date (" %B" )
708720 local short_month = os.date (" %b" )
@@ -753,6 +765,7 @@ function dtutils_string.build_substitution_list(image, sequence, variable_string
753765 short_month , -- MONTH.SHORT
754766 string.format (" %02d" , datetime .day ), -- DAY
755767 string.format (" %02d" , datetime .hour ), -- HOUR
768+ " " , -- HOUR.AMPM
756769 string.format (" %02d" , datetime .min ), -- MINUTE
757770 string.format (" %02d" , datetime .sec ), -- SECOND
758771 0 , -- MSEC
@@ -763,6 +776,7 @@ function dtutils_string.build_substitution_list(image, sequence, variable_string
763776 os.date (" %b" , exiftime2systime (image .exif_datetime_taken )), -- EXIF.MONTH.SHORT
764777 eday , -- EXIF.DAY
765778 ehour , -- EXIF.HOUR
779+ " " , -- EXIF.HOUR.AMPM
766780 emin , -- EXIF.MINUTE
767781 esec , -- EXIF.SECOND
768782 emsec , -- EXIF.MSEC
@@ -771,12 +785,23 @@ function dtutils_string.build_substitution_list(image, sequence, variable_string
771785 string.format (" %d" , image .exif_iso ), -- EXIF.ISO
772786 string.format (" %.0f" , 1. / image .exif_exposure ), -- EXIF.EXPOSURE
773787 image .exif_exposure_bias , -- EXIF.EXPOSURE.BIAS
788+ " " , -- EXIF.EXPOSURE.PROGRAM
774789 string.format (" %.01f" , image .exif_aperture ), -- EXIF.APERTURE
775790 string.format (" %.01f" , image .exif_crop ),-- EXIF.CROP_FACTOR
776791 string.format (" %.0f" , image .exif_focal_length ), -- EXIF.FOCAL.LENGTH
777792 string.format (" %.0f" , image .exif_focal_length * image .exif_crop ), -- EXIF.FOCAL.LENGTH.EQUIV
778793 image .exif_focus_distance , -- EXIF.FOCUS.DISTANCE
779- " " , -- IMAGE.EXIF
794+ image .exif_maker , -- EXIF.MAKER
795+ image .exif_model , -- EXIF.MODEL
796+ is_api_9_4 and image .exif_whitebalance or " " , -- EXIF.WHITEBALANCE
797+ is_api_9_4 and image .exif_metering_mode or " " , -- EXIF.METERING
798+ image .exif_lens , -- LENS
799+ " " , -- EXIF.FLASH.ICON
800+ is_api_9_4 and image .exif_flash or " " , -- EXIF.FLASH
801+ " " , -- GPS.LONGITUDE
802+ " " , -- GPS.LATITUDE
803+ " " , -- GPS.ELEVATION
804+ " " , -- GPS.LOCATION.ICON
780805 image .longitude or " " , -- LONGITUDE
781806 image .latitude or " " , -- LATITUDE
782807 image .elevation or " " , -- ELEVATION
@@ -785,9 +810,6 @@ function dtutils_string.build_substitution_list(image, sequence, variable_string
785810 " " , -- RATING.ICONS - wont be implemented
786811 labels , -- LABELS
787812 " " , -- LABELS.ICONS - wont be implemented
788- image .exif_maker , -- MAKER
789- image .exif_model , -- MODEL
790- image .exif_lens , -- LENS
791813 image .title , -- TITLE
792814 image .description , -- DESCRIPTION
793815 image .creator , -- CREATOR
@@ -834,94 +856,96 @@ dtutils_string.libdoc.functions["get_substitution_tooltip"] = {
834856}
835857
836858function dtutils_string .get_substitution_tooltip ()
837- return _ (" $(ROLL.NAME) - roll of the input image" ) .. " \n " ..
838- _ (" $(FILE.FOLDER) - folder containing the input image" ) .. " \n " ..
839- _ (" $(FILE.NAME) - basename of the input image" ) .. " \n " ..
840- _ (" $(FILE.EXTENSION) - extension of the input image" ) .. " \n " ..
841- _ (" $(ID) - image ID" ) .. " \n " ..
842- _ (" $(VERSION) - duplicate version" ) .. " \n " ..
843- _ (" $(VERSION.IF_MULTI) - same as $(VERSION) but null string if only one version exists" ) .. " \n " ..
844- _ (" $(VERSION.NAME) - version name from metadata" ) .. " \n " ..
845- _ (" $(DARKTABLE.VERSION) - current darktable version" ) .. " \n " ..
846- -- _("$(DARKTABLE.NAME) - darktable name") .. "\n" .. -- not implemented
847- _ (" $(SEQUENCE[n,m]) - sequence number, n: number of digits, m: start number" ) .. " \n " ..
848- _ (" $(WIDTH.SENSOR) - image sensor width" ) .. " \n " ..
849- _ (" $(HEIGHT.SENSOR) - image sensor height" ) .. " \n " ..
850- _ (" $(WIDTH.RAW) - RAW image width" ) .. " \n " ..
851- _ (" $(HEIGHT.RAW) - RAW image height" ) .. " \n " ..
852- _ (" $(WIDTH.CROP) - image width after crop" ) .. " \n " ..
853- _ (" $(HEIGHT.CROP) - image height after crop" ) .. " \n " ..
854- _ (" $(WIDTH.EXPORT) - exported image width" ) .. " \n " ..
855- _ (" $(HEIGHT.EXPORT) - exported image height" ) .. " \n " ..
856- -- _("$(WIDTH.MAX) - maximum image export width") .. "\n" .. -- not implemented
857- -- _("$(HEIGHT.MAX) - maximum image export height") .. "\n" .. -- not implemented
858- _ (" $(YEAR) - year" ) .. " \n " ..
859- _ (" $(YEAR.SHORT) - year without century" ) .. " \n " ..
860- _ (" $(MONTH) - month" ) .. " \n " ..
861- _ (" $(MONTH.LONG) - full month name according to the current locale" ) .. " \n " ..
862- _ (" $(MONTH.SHORT) - abbreviated month name according to the current locale" ) .. " \n " ..
863- _ (" $(DAY) - day" ) .. " \n " ..
864- _ (" $(HOUR) - hour" ) .. " \n " ..
865- -- _("$(HOUR.AMPM) - hour, 12-hour clock") .. "\n" .. -- not implemented
866- _ (" $(MINUTE) - minute" ) .. " \n " ..
867- _ (" $(SECOND) - second" ) .. " \n " ..
868- _ (" $(MSEC) - millisecond" ) .. " \n " ..
869- _ (" $(EXIF.YEAR) - EXIF year" ) .. " \n " ..
870- _ (" $(EXIF.YEAR.SHORT) - EXIF year without century" ) .. " \n " ..
871- _ (" $(EXIF.MONTH) - EXIF month" ) .. " \n " ..
872- _ (" $(EXIF.MONTH.LONG) - full EXIF month name according to the current locale" ) .. " \n " ..
873- _ (" $(EXIF.MONTH.SHORT) - abbreviated EXIF month name according to the current locale" ) .. " \n " ..
874- _ (" $(EXIF.DAY) - EXIF day" ) .. " \n " ..
875- _ (" $(EXIF.HOUR) - EXIF hour" ) .. " \n " ..
859+
860+ return table.concat ({
861+ _ (" $(ROLL.NAME) - roll of the input image" ),
862+ _ (" $(FILE.FOLDER) - folder containing the input image" ),
863+ _ (" $(FILE.NAME) - basename of the input image" ),
864+ _ (" $(FILE.EXTENSION) - extension of the input image" ),
865+ _ (" $(ID) - image ID" ),
866+ _ (" $(VERSION) - duplicate version" ),
867+ _ (" $(VERSION.IF_MULTI) - same as $(VERSION) but null string if only one version exists" ),
868+ _ (" $(VERSION.NAME) - version name from metadata" ),
869+ _ (" $(DARKTABLE.VERSION) - current darktable version" ),
870+ -- _("$(DARKTABLE.NAME) - darktable name"), -- not implemented
871+ _ (" $(SEQUENCE[n,m]) - sequence number, n: number of digits, m: start number" ),
872+ _ (" $(WIDTH.SENSOR) - image sensor width" ),
873+ _ (" $(HEIGHT.SENSOR) - image sensor height" ),
874+ _ (" $(WIDTH.RAW) - RAW image width" ),
875+ _ (" $(HEIGHT.RAW) - RAW image height" ),
876+ _ (" $(WIDTH.CROP) - image width after crop" ),
877+ _ (" $(HEIGHT.CROP) - image height after crop" ),
878+ _ (" $(WIDTH.EXPORT) - exported image width" ),
879+ _ (" $(HEIGHT.EXPORT) - exported image height" ),
880+ -- _("$(WIDTH.MAX) - maximum image export width"), -- not implemented
881+ -- _("$(HEIGHT.MAX) - maximum image export height"), -- not implemented
882+ _ (" $(YEAR) - year" ),
883+ _ (" $(YEAR.SHORT) - year without century" ),
884+ _ (" $(MONTH) - month" ),
885+ _ (" $(MONTH.LONG) - full month name according to the current locale" ),
886+ _ (" $(MONTH.SHORT) - abbreviated month name according to the current locale" ),
887+ _ (" $(DAY) - day" ),
888+ _ (" $(HOUR) - hour" ),
889+ -- _("$(HOUR.AMPM) - hour, 12-hour clock"), -- not implemented
890+ _ (" $(MINUTE) - minute" ),
891+ _ (" $(SECOND) - second" ),
892+ _ (" $(MSEC) - millisecond" ),
893+ _ (" $(EXIF.YEAR) - EXIF year" ),
894+ _ (" $(EXIF.YEAR.SHORT) - EXIF year without century" ),
895+ _ (" $(EXIF.MONTH) - EXIF month" ),
896+ _ (" $(EXIF.MONTH.LONG) - full EXIF month name according to the current locale" ),
897+ _ (" $(EXIF.MONTH.SHORT) - abbreviated EXIF month name according to the current locale" ),
898+ _ (" $(EXIF.DAY) - EXIF day" ),
899+ _ (" $(EXIF.HOUR) - EXIF hour" ),
876900 -- _("$(EXIF.HOUR.AMPM) - EXIF hour, 12-hour clock") .. "\n" .. -- not implemented
877- _ (" $(EXIF.MINUTE) - EXIF minute" ) .. " \n " ..
878- _ (" $(EXIF.SECOND) - EXIF second" ) .. " \n " ..
879- _ (" $(EXIF.MSEC) - EXIF millisecond" ) .. " \n " ..
880- -- _("$(EXIF.DATE.REGIONAL) - localized EXIF date") .. "\n" .. -- not implemented
881- -- _("$(EXIF.TIME.REGIONAL) - localized EXIF time") .. "\n" .. -- not implemented
882- _ (" $(EXIF.ISO) - ISO value" ) .. " \n " ..
883- _ (" $(EXIF.EXPOSURE) - EXIF exposure" ) .. " \n " ..
884- _ (" $(EXIF.EXPOSURE.BIAS) - EXIF exposure bias" ) .. " \n " ..
885- -- _("$(EXIF.EXPOSURE.PROGRAM) - EXIF exposure program") .. "\n" .. -- not implemented
886- _ (" $(EXIF.APERTURE) - EXIF aperture" ) .. " \n " ..
887- _ (" $(EXIF.CROP_FACTOR) - EXIF crop factor" ) .. " \n " ..
888- _ (" $(EXIF.FOCAL.LENGTH) - EXIF focal length" ) .. " \n " ..
889- _ (" $(EXIF.FOCAL.LENGTH.EQUIV) - EXIF 35 mm equivalent focal length" ) .. " \n " ..
890- _ (" $(EXIF.FOCUS.DISTANCE) - EXIF focal distance" ) .. " \n " ..
901+ _ (" $(EXIF.MINUTE) - EXIF minute" ),
902+ _ (" $(EXIF.SECOND) - EXIF second" ),
903+ _ (" $(EXIF.MSEC) - EXIF millisecond" ),
904+ -- _("$(EXIF.DATE.REGIONAL) - localized EXIF date"), -- not implemented
905+ -- _("$(EXIF.TIME.REGIONAL) - localized EXIF time"), -- not implemented
906+ _ (" $(EXIF.ISO) - ISO value" ),
907+ _ (" $(EXIF.EXPOSURE) - EXIF exposure" ),
908+ _ (" $(EXIF.EXPOSURE.BIAS) - EXIF exposure bias" ),
909+ -- _("$(EXIF.EXPOSURE.PROGRAM) - EXIF exposure program"), -- not implemented
910+ _ (" $(EXIF.APERTURE) - EXIF aperture" ),
911+ _ (" $(EXIF.CROP_FACTOR) - EXIF crop factor" ),
912+ _ (" $(EXIF.FOCAL.LENGTH) - EXIF focal length" ),
913+ _ (" $(EXIF.FOCAL.LENGTH.EQUIV) - EXIF 35 mm equivalent focal length" ),
914+ _ (" $(EXIF.FOCUS.DISTANCE) - EXIF focal distance" ),
891915 _ (" $(EXIF.MAKER) - camera maker" ) ..
892916 _ (" $(EXIF.MODEL) - camera model" ) ..
893- -- _("$(EXIF.WHITEBALANCE) - EXIF selected white balance") .. -- not implemented
894- -- _("$(EXIF.METERING) - EXIF exposure metering mode") .. -- not implemented
917+ _ (" $(EXIF.WHITEBALANCE) - EXIF selected white balance" ) .. -- not implemented
918+ _ (" $(EXIF.METERING) - EXIF exposure metering mode" ) .. -- not implemented
895919 _ (" $(EXIF.LENS) - lens" ) ..
896920 -- _("$(EXIF.FLASH.ICON) - icon indicating whether flash was used") .. -- not implemented
897- -- _("$(EXIF.FLASH) - was flash used (yes/no/--)") .. -- not implemented
898- -- _("$(GPS.LONGITUDE) - longitude") .. "\n" .. -- not implemented
899- -- _("$(GPS.LATITUDE) - latitude") .. "\n" .. -- not implemented
900- -- _("$(GPS.ELEVATION) - elevation") .. "\n" .. -- not implemented
901- -- _("$(GPS.LOCATION.ICON) - icon indicating whether GPS location is known") .. "\n" .. -- not implemented
902- _ (" $(LONGITUDE) - longitude" ) .. " \n " ..
903- _ (" $(LATITUDE) - latitude" ) .. " \n " ..
904- _ (" $(ELEVATION) - elevation" ) .. " \n " ..
905- _ (" $(STARS) - star rating as number (-1 for rejected)" ) .. " \n " ..
906- -- _("$(RATING.ICONS) - star/reject rating in icon form") .. "\n" .. -- not implemented
907- _ (" $(LABELS) - color labels as text" ) .. " \n " ..
908- -- _("$(LABELS.ICONS) - color labels as icons") .. "\n" .. -- not implemented
909- _ (" $(TITLE) - title from metadata" ) .. " \n " ..
910- _ (" $(DESCRIPTION) - description from metadata" ) .. " \n " ..
911- _ (" $(CREATOR) - creator from metadata" ) .. " \n " ..
912- _ (" $(PUBLISHER) - publisher from metadata" ) .. " \n " ..
913- _ (" $(RIGHTS) - rights from metadata" ) .. " \n " ..
914- -- _("$(TAGS) - tags as set in metadata settings") .. "\n" ..
915- _ (" $(CATEGORY[n,category]) - subtag of level n in hierarchical tags" ) .. " \n " ..
916- _ (" $(SIDECAR_TXT) - contents of .txt sidecar file, if present" ) .. " \n " ..
917- _ (" $(FOLDER.PICTURES) - pictures folder" ) .. " \n " ..
918- _ (" $(FOLDER.HOME) - home folder" ) .. " \n " ..
919- _ (" $(FOLDER.DESKTOP) - desktop folder" ) .. " \n " ..
920- -- _("$(OPENCL.ACTIVATED) - whether OpenCL is activated") .. "\n" ..
921- _ (" $(USERNAME) - login name" ) .. " \n " ..
922- -- _("$(NL) - newline") .. "\n" ..
923- -- _("$(JOBCODE) - job code for import") .. "\n" ..
924- " "
921+ _ (" $(EXIF.FLASH) - was flash used (yes/no/--)" ) .. -- not implemented
922+ -- _("$(GPS.LONGITUDE) - longitude"), -- not implemented
923+ -- _("$(GPS.LATITUDE) - latitude"), -- not implemented
924+ -- _("$(GPS.ELEVATION) - elevation"), -- not implemented
925+ -- _("$(GPS.LOCATION.ICON) - icon indicating whether GPS location is known"), -- not implemented
926+ _ (" $(LONGITUDE) - longitude" ),
927+ _ (" $(LATITUDE) - latitude" ),
928+ _ (" $(ELEVATION) - elevation" ),
929+ _ (" $(STARS) - star rating as number (-1 for rejected)" ),
930+ -- _("$(RATING.ICONS) - star/reject rating in icon form"), -- not implemented
931+ _ (" $(LABELS) - color labels as text" ),
932+ -- _("$(LABELS.ICONS) - color labels as icons"), -- not implemented
933+ _ (" $(TITLE) - title from metadata" ),
934+ _ (" $(DESCRIPTION) - description from metadata" ),
935+ _ (" $(CREATOR) - creator from metadata" ),
936+ _ (" $(PUBLISHER) - publisher from metadata" ),
937+ _ (" $(RIGHTS) - rights from metadata" ),
938+ -- _("$(TAGS) - tags as set in metadata settings"),
939+ _ (" $(CATEGORY[n,category]) - subtag of level n in hierarchical tags" ),
940+ _ (" $(SIDECAR_TXT) - contents of .txt sidecar file, if present" ),
941+ _ (" $(FOLDER.PICTURES) - pictures folder" ),
942+ _ (" $(FOLDER.HOME) - home folder" ),
943+ _ (" $(FOLDER.DESKTOP) - desktop folder" ),
944+ -- _("$(OPENCL.ACTIVATED) - whether OpenCL is activated"),
945+ _ (" $(USERNAME) - login name" ),
946+ -- _("$(NL) - newline"),
947+ -- _("$(JOBCODE) - job code for import"),
948+ " " }, " \n " )
925949end
926950
927951-- handle different versions of names
@@ -957,6 +981,7 @@ local function treat(var_string)
957981 if string.match (var_string , " CATEGORY%d" ) or string.match (var_string , " CATEGORY%[" ) then
958982 log .msg (log .info , " substituting for " .. var_string )
959983 ret_val = substitutes [var_string ]
984+ if not ret_val then ret_val = " "
960985 log .msg (log .info , " ret_val is " .. ret_val )
961986
962987 elseif string.match (var_string , " SEQUENCE%[" ) then
0 commit comments