date and time of image files
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
date and time of image files
Hi all,
how can I gathers date and time metadata from the image files?
I need to retrieve the date a photo was created before importing it.
Any idea?
Thanks.
how can I gathers date and time metadata from the image files?
I need to retrieve the date a photo was created before importing it.
Any idea?
Thanks.
-
- VIP Livecode Opensource Backer
- Posts: 129
- Joined: Sun Feb 20, 2011 4:26 pm
- Location: Vancouver Island, BC, Canada. ex.UK
- Contact:
Re: date and time of image files
Sorry I don't have time to explain more right now, but checkout the function for 'detailed files' or 'long files' in the dictionary.
It will give you all the data you need.
Link: https://livecode.com/resources/api/#liv ... ript/files
Paul
It will give you all the data you need.
Link: https://livecode.com/resources/api/#liv ... ript/files
Paul
Re: date and time of image files
EXIF library is here for you: https://github.com/angerangel/livecodeExif
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: date and time of image files
Hi Max,
I use "detailed files" with a simple lineoffset (to get the target line) to do that.
from dictionary about "detailed files"
http://forums.livecode.com/viewtopic.ph ... 23#p151263
Best regards
Jean-Marc
I use "detailed files" with a simple lineoffset (to get the target line) to do that.
from dictionary about "detailed files"
Here is a Richard's scriptto obtain a date, time, name, ID, or list of files or folders with the greatest amount of available detail.
http://forums.livecode.com/viewtopic.ph ... 23#p151263
Best regards
Jean-Marc
https://alternatic.ch
Re: date and time of image files
Please note that images may have an internal data structure called EXIF. The EXIF tags have a lot of informations, like creation date.
The operating systems has information about files, but only regarding the operation system itself; creation date is external to file, and is about the filesystem hierarchy.
So a copied file can have a newer creation date, because is new; on the contrary the EXIF datas remain unchanged even copied, because their are internal data of the image.
The operating systems has information about files, but only regarding the operation system itself; creation date is external to file, and is about the filesystem hierarchy.
So a copied file can have a newer creation date, because is new; on the contrary the EXIF datas remain unchanged even copied, because their are internal data of the image.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: date and time of image files
Hi Max,
Thanks for share.
I'm impatient to use it for one script that check if an image exist in a folder (same data with different filename)
Best regards
Jean-Marc
Thanks for share.
Very interesting and it seems simple to use.the EXIF datas remain unchanged even copied
I'm impatient to use it for one script that check if an image exist in a folder (same data with different filename)
Best regards
Jean-Marc
https://alternatic.ch
Re: date and time of image files
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: date and time of image files
Bump!
I stumbled across this thread and thought I would add the following system call that works on MacOS:
Terminal describes the syntax:
Simon K.
I stumbled across this thread and thought I would add the following system call that works on MacOS:
Code: Select all
put shell("mdls -raw -name kMDItemContentCreationDate '" & tImageFileSpec & "'" ) into tMyVar
Example output :usage: mdls [-name attr][-sdb] [-raw [-nullMarker markerString]] [-plist file] path
list the values of one or all the attributes of the specified file
-raw: don't print attribute names before values
-nullMarker: substitute this string for null attributes in raw mode
-plist: output attributes in XML format to file. Use - to write to stdout
option -plist is incompatible with options -raw, -nullMarker, and -name
example: mdls ~/Pictures/Birthday.jpg
example: mdls -name Keyword ~/Pictures/Birthday.jpg
best wishes_kMDItemDisplayNameWithExtensions = "20191128_194059_Didcot_Joe_McNally_P1024114.RW2"
kMDItemAcquisitionMake = "Panasonic"
kMDItemAcquisitionModel = "DC-G9"
kMDItemBitsPerSample = 64
kMDItemColorSpace = "RGB"
kMDItemContentCreationDate = 2019-11-28 19:40:59 +0000
kMDItemContentCreationDate_Ranking = 2019-11-28 00:00:00 +0000
kMDItemContentModificationDate = 2019-11-28 19:40:59 +0000
kMDItemContentModificationDate_Ranking = 2019-11-28 00:00:00 +0000
kMDItemContentType = "com.panasonic.rw2-raw-image"
kMDItemContentTypeTree = (
"com.panasonic.rw2-raw-image",
"public.camera-raw-image",
"public.image",
"public.data",
"public.item",
"public.content"
)
kMDItemCreator = "Ver.1.2 "
kMDItemDateAdded = 2019-12-15 11:41:01 +0000
kMDItemDateAdded_Ranking = 2019-12-15 00:00:00 +0000
kMDItemDisplayName = "20191128_194059_Didcot_Joe_McNally_P1024114.RW2"
kMDItemDocumentIdentifier = 0
kMDItemEXIFVersion = "2.3.1"
kMDItemExposureMode = 0
kMDItemExposureProgram = 3
kMDItemExposureTimeSeconds = 0.06666666666666667
kMDItemFlashOnOff = 0
kMDItemFNumber = 1.4
kMDItemFocalLength = 25
kMDItemFocalLength35mm = 50
kMDItemFSContentChangeDate = 2019-12-15 11:41:01 +0000
kMDItemFSCreationDate = 2019-12-15 11:41:01 +0000
kMDItemFSCreatorCode = "ttxt"
kMDItemFSFinderFlags = 0
kMDItemFSHasCustomIcon = (null)
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery = (null)
kMDItemFSLabel = 0
kMDItemFSName = "20191128_194059_Didcot_Joe_McNally_P1024114.RW2"
kMDItemFSNodeCount = (null)
kMDItemFSOwnerGroupID = 20
kMDItemFSOwnerUserID = 501
kMDItemFSSize = 23960064
kMDItemFSTypeCode = "TEXT"
kMDItemHasAlphaChannel = 0
kMDItemInterestingDate_Ranking = 2019-11-28 00:00:00 +0000
kMDItemISOSpeed = 800
kMDItemKind = "Affinity Openable"
kMDItemLensModel = "LEICA DG SUMMILUX 25/F1.4 "
kMDItemLogicalSize = 23960064
kMDItemMeteringMode = 5
kMDItemOrientation = 0
kMDItemPhysicalSize = 23961600
kMDItemPixelCount = 20155392
kMDItemPixelHeight = 3888
kMDItemPixelWidth = 5184
kMDItemProfileName = "Display P3"
kMDItemRedEyeOnOff = 0
kMDItemWhiteBalance = 1
Simon K.
best wishes
Skids
Skids
Re: date and time of image files
Isn't macOS wonderful?
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: date and time of image files
Yes but I'm still mad that I'm not allowed to see colour or custom icons in the Finder side bar grrrrrr!
best wishes
Simon K.
best wishes
Simon K.
best wishes
Skids
Skids