Photo Processing , Gallery and IPTC Data app

David Bovill david at openpartnership.net
Mon May 26 06:50:25 EDT 2008


I think for reading EXIF metadata it works well to fetch the properties in
one go and construct an array. I am not entirely sure which of the hundreds
of tags are being returned - but the list seems comprehensive and truncate
to only tose that actually contain data"

--> EXIF
> -
> function exif_GetTag tagName, imageFile, padded
>     put exif_GetTagLine(tagName, imageFile, empty) into tagLine
>     return tagLine
>
>     -- using exif (http://libexif.sourceforge.net/
> http://exif.darwinports.com/)
>     shell_BashParamEscape imageFile
>     shell_BashParamEscape tagName
>     put "exif -t" && tagName && imageFile into someShell
>     return shell(someShell)
> end exif_GetTag
>
> function exif_GetTagLine tagName, imageFile, padded
>     --  Using exiftool (
> http://sno.phy.queensu.ca/%7Ephil/exiftool/exiftool_pod.html#reading_examples
> )
>     shell_BashParamEscape imageFile
>
>     if padded is true then
>         put "exiftool -s -" & tagName && imageFile into someShell
>     else
>         put "exiftool -s -s -" & tagName  && imageFile into someShell
>     end if
>     put someShell
>     return shell(someShell)
> end exif_GetTagLine
>
> function exif_GetMetaDataArray imageFile
>     put exif_GetMetaData(imageFile) into metaDataArray
>     replace ": " with tab in metaDataArray
>     split metaDataArray with CR and tab
>     return metaDataArray
> end exif_GetMetaDataArray
>
> function exif_GetMetaData imageFile, pretty
>     /*
>     Using exiftool (
> http://sno.phy.queensu.ca/%7Ephil/exiftool/exiftool_pod.html#reading_examples
> )
>     print all meta information in an image, including duplicate and unknown
> tags, sorted by group (for family 1).
>     */
>
>     shell_BashParamEscape imageFile
>     if pretty is true then
>         put "exiftool -s -a -u -g1" && imageFile into someShell
>     else
>         put "exiftool -s -s -u" && imageFile into someShell
>     end if
>     return word 1 to -1 of shell(someShell)
> end exif_GetMetaData
>



More information about the use-livecode mailing list