diff --git a/src/backend/model/fileaccess/MetadataCreationDate.ts b/src/backend/model/fileaccess/MetadataCreationDate.ts index 3a36419f..f4081c2f 100644 --- a/src/backend/model/fileaccess/MetadataCreationDate.ts +++ b/src/backend/model/fileaccess/MetadataCreationDate.ts @@ -2,51 +2,33 @@ //tagname1 is typically a full date time, but in some cases tagname1 and tagname2 together make up a full timestamp -const metadataTags: [string, string, string][] = [ - // EXIF tags - ["exif.DateTimeOriginal", "exif.OffsetTimeOriginal", "Date and time when the original image was taken"], - ["exif.CreateDate", "exif.OffsetTime", "Date and time when the image was created"], - ["xmp:CreateDate", "", "Date and time when the image was created (XMP standard)"], - ["exif.DateTimeDigitized", "exif.OffsetTimeDigitized", "Date and time when the image was digitized"], - ["iptc.DateCreated", "iptc.TimeCreated", "Date and time when the image was created (IPTC standard)"], - ["ihdr.Creation Time", "", "PNG Creation Time"], - - // TIFF tags - ["TIFF.DateTime", "", "Date and time when the image was created (TIFF standard)"], - - // QuickTime tags - ["quicktime.CreationDate", "", "Date and time when the QuickTime movie was created"], - ["quicktime.CreateDate", "", "Date and time when the QuickTime movie was created in UTC"], - - //Photoshop tags - ["photoshop.DateCreated", "", "Date and time when the image was created"], - - // AVI tags - ["AVI.CreationTime", "", "Date and time when the AVI video was created"], - - // MP4 tags - ["MP4.CreationTime", "", "Date and time when the MP4 video was created"], - ["MP4.ModifyDate", "", "Date and time when the MP4 video was last modified"], - - // WebP tags - ["WebP.VP8X/Time", "", "Date and time when the WebP image was created"], - - - // HEIC tags - ["heic.ContentCreateDate", "", "Date and time when the HEIC image content was created"], - ["heic.CreationDate", "", "Date and time when the HEIC image was created"], - - // RAW image format tags - ["cr2.DateTimeOriginal", "", "Date and time when the original Canon RAW image was taken"], - ["nef.DateTimeOriginal", "", "Date and time when the original Nikon RAW image was taken"], - ["dng.DateTimeOriginal", "", "Date and time when the original DNG image was taken"], - ["rw2.DateTimeOriginal", "", "Date and time when the original Panasonic RAW image was taken"], - ["arw.DateTimeOriginal", "", "Date and time when the original Sony Alpha RAW image was taken"], - ["cr3.DateTimeOriginal", "", "Date and time when the original Canon RAW image was taken"], - ["sr2.DateTimeOriginal", "", "Date and time when the original Sony RAW image was taken"], - ["orf.DateTimeOriginal", "", "Date and time when the original Olympus RAW image was taken"], - - ["ifd0.ModifyDate", "", "Modificaton date from the idf0 section"], - ["xmp:ModifyDate", "", "Date and time when the image was last modified (XMP standard)"] - +const metadataTags: [string, string][] = [ + // Date tag Offset or time tag // Description + ["exif.DateTimeOriginal", "exif.OffsetTimeOriginal"], //"Date and time when the original image was taken - shutter close time" + ["exif.CreateDate", "exif.OffsetTime"], //"Date and time when the image was created"], + ["ifd0.ModifyDate", ""], //"Modificaton date from the idf0 section"], + ["ihdr.Creation Time", ""], //"PNG Creation Time"], + ["photoshop.DateCreated", ""], //"Date and time when the image was created"], + ["xmp:CreateDate", ""], //"Date and time when the image was created (XMP standard)"], + ["iptc.DateCreated", "iptc.TimeCreated"], //"Date and time when the image was created (IPTC standard)"], + ["exif.DateTimeDigitized", "exif.OffsetTimeDigitized"], //"Date and time when the image was digitized"], + ["xmp.MetadataDate", ""], //?????????? + ["TIFF.DateTime", ""], //"Date and time when the image was created (TIFF standard)"], + ["quicktime.CreationDate", ""], //"Date and time when the QuickTime movie was created"], + ["quicktime.CreateDate", ""], //"Date and time when the QuickTime movie was created in UTC"], + ["AVI.CreationTime", ""], //"Date and time when the AVI video was created"], + ["MP4.CreationTime", ""], //"Date and time when the MP4 video was created"], + ["MP4.ModifyDate", ""], //"Date and time when the MP4 video was last modified"], + ["WebP.VP8X/Time", ""], //"Date and time when the WebP image was created"], + ["heic.ContentCreateDate", ""], //"Date and time when the HEIC image content was created"], + ["heic.CreationDate", ""], //"Date and time when the HEIC image was created"], + ["cr2.DateTimeOriginal", ""], //"Date and time when the original Canon RAW image was taken"], + ["nef.DateTimeOriginal", ""], //"Date and time when the original Nikon RAW image was taken"], + ["dng.DateTimeOriginal", ""], //"Date and time when the original DNG image was taken"], + ["rw2.DateTimeOriginal", ""], //"Date and time when the original Panasonic RAW image was taken"], + ["arw.DateTimeOriginal", ""], //"Date and time when the original Sony Alpha RAW image was taken"], + ["cr3.DateTimeOriginal", ""], //"Date and time when the original Canon RAW image was taken"], + ["sr2.DateTimeOriginal", ""], //"Date and time when the original Sony RAW image was taken"], + ["orf.DateTimeOriginal", ""], //"Date and time when the original Olympus RAW image was taken"], + ["xmp:ModifyDate", ""], //"Date and time when the image was last modified (XMP standard)"] ]; \ No newline at end of file diff --git a/src/common/Utils.ts b/src/common/Utils.ts index 7dc76c62..c51e4ba2 100644 --- a/src/common/Utils.ts +++ b/src/common/Utils.ts @@ -230,6 +230,10 @@ export class Utils { } } + static getLocalTimeMS(creationDate: number, creationDateOffset: string) { + const offsetMinutes = Utils.getOffsetMinutes(creationDateOffset); + return creationDate + (offsetMinutes ? (offsetMinutes * 60000) : 0); + } static isLeapYear(year: number) { return (0 == year % 4) && (0 != year % 100) || (0 == year % 400) diff --git a/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203430-Auckland.jpg b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203430-Auckland.jpg new file mode 100644 index 00000000..e2245adb Binary files /dev/null and b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203430-Auckland.jpg differ diff --git a/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203530-Montevideo.jpg b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203530-Montevideo.jpg new file mode 100644 index 00000000..3102d805 Binary files /dev/null and b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203530-Montevideo.jpg differ diff --git a/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203531-Kathmandu.jpg b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203531-Kathmandu.jpg new file mode 100644 index 00000000..bf3cbe96 Binary files /dev/null and b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203531-Kathmandu.jpg differ diff --git a/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203630-London.jpg b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203630-London.jpg new file mode 100644 index 00000000..b59dc854 Binary files /dev/null and b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203630-London.jpg differ diff --git a/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203720-Tokyo.jpg b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203720-Tokyo.jpg new file mode 100644 index 00000000..9efd4ded Binary files /dev/null and b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203720-Tokyo.jpg differ diff --git a/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203730-Reykjavik.jpg b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203730-Reykjavik.jpg new file mode 100644 index 00000000..852bfc50 Binary files /dev/null and b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203730-Reykjavik.jpg differ diff --git a/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203830-NewYork.jpg b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203830-NewYork.jpg new file mode 100644 index 00000000..62cb4584 Binary files /dev/null and b/test/backend/assets/4MinsAroundTheWorld/UTC-20240413-203830-NewYork.jpg differ