Image File Metadata accessibility?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 11
- Joined: Sat Oct 14, 2006 2:08 pm
Image File Metadata accessibility?
Hi. I have been away from Revolution for a year or so and am just picking up with the current Studio version.
I need to integrate Revolution into the workflow of my art conservation laboratory.
One of the things I want to explore is what metadata which is entrained in a TIFF or PNG (I haven't actually explored PNG metadata but think this is the file type I may need to use) is accessible through Revolution to read, write to and to preserve?
We use Nikon digital cameras (D200) and keep both the raw Nikon format file but also TIFF versions along with jpeg thumbnails where we can tolerate the lossy format.
I appreciate any and all information. I do not expect to be able to work with the Nikon proprietary raw format but much information can be captured and used with more universal file formats.
Regards
Mark MacKenzie
I need to integrate Revolution into the workflow of my art conservation laboratory.
One of the things I want to explore is what metadata which is entrained in a TIFF or PNG (I haven't actually explored PNG metadata but think this is the file type I may need to use) is accessible through Revolution to read, write to and to preserve?
We use Nikon digital cameras (D200) and keep both the raw Nikon format file but also TIFF versions along with jpeg thumbnails where we can tolerate the lossy format.
I appreciate any and all information. I do not expect to be able to work with the Nikon proprietary raw format but much information can be captured and used with more universal file formats.
Regards
Mark MacKenzie
Mark MacKenzie
Art Conservator
Alcalde, NM
Art Conservator
Alcalde, NM
If it's a public format (like png) then there's probably a rfc or similar defining document somewhere on the net. You can then find out what chunk of a file contains your meta data, and read that out. Most likely you'll need to use the binary stuff for that, so look up these entries in the docu:
binaryEncode function
binaryDecode function
bitOr operator
bitAnd operator
bitXOr operator
bitAnd operator
baseConvert function
Said all that, I think some metadata libraries have already been done, and are available on revNet or some homepage. I only know that Udi has made one for jpg (seems it can do tiff too), so maybe that one can give you hints about what to do for png's.
If that's all too complex for you, there's probably some command line or applescript you can hook into (this depends on the target platform(s) of course).
binaryEncode function
binaryDecode function
bitOr operator
bitAnd operator
bitXOr operator
bitAnd operator
baseConvert function
Said all that, I think some metadata libraries have already been done, and are available on revNet or some homepage. I only know that Udi has made one for jpg (seems it can do tiff too), so maybe that one can give you hints about what to do for png's.
If that's all too complex for you, there's probably some command line or applescript you can hook into (this depends on the target platform(s) of course).
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Though it's an old post, I've the same problem: I have to retreive some basic data from JPEG files like size and resolution.
I tried UDI's getJpegPixelSize but it doesn't seem to work (it says my JPEG file is not JPEG because "Error : File is not JPEG (not found APPx)", though it's a JPEG!).
I also tried UDI's getExif14 but, of course, it only works with image containing EXIF data.
So, is anybody know how could I retreive size and resolution from a JPEG file. I know I should use rev ImageData and binary things but it's really out of my understanding.
Thanks for your help.
I tried UDI's getJpegPixelSize but it doesn't seem to work (it says my JPEG file is not JPEG because "Error : File is not JPEG (not found APPx)", though it's a JPEG!).
I also tried UDI's getExif14 but, of course, it only works with image containing EXIF data.
So, is anybody know how could I retreive size and resolution from a JPEG file. I know I should use rev ImageData and binary things but it's really out of my understanding.
Thanks for your help.
If your using this from Mac OS X, there are some shell scripts that are for metadata that may help. I am unsure what if any are available from windows. Maybe someone else would be kind enough to list them, if there are any.
mdls(1) Returns the values of all metadata attributes associated with the files provided.
How it could be used. I tested this in rev and work pretty good.
example from rev:
Above in that example it did not render the text good in the code box. It looks like a slash, it not it's one of these ~
the mdls also allows to get just listed attributes using the " mdls -name theAttributeName yourfilepath/file"
example
Some of the other associated commands, open the terminal and search there man pages for complete info.
mdfind(1) consults the central metadata store and returns a list
of files that match the given metadata query. The query can be a string
or a query expression.
mdimport(1) import file hierarchies into the metadata datastore.
mdcheckschema(1) validates the mdimporter schema files provided as arguments and indicates whether the schema could be successfully parsed.
Not sure if this helps or not.
Good luck.
mdls(1) Returns the values of all metadata attributes associated with the files provided.
How it could be used. I tested this in rev and work pretty good.
example from rev:
Code: Select all
put shell("mdls ~/Pitctures/myFile.tiff ") into fld "yourMetaDataField"
the mdls also allows to get just listed attributes using the " mdls -name theAttributeName yourfilepath/file"
example
Code: Select all
mdls -name kMDItemColorSpace ~/Pitctures/myFile.tiff
mdfind(1) consults the central metadata store and returns a list
of files that match the given metadata query. The query can be a string
or a query expression.
mdimport(1) import file hierarchies into the metadata datastore.
mdcheckschema(1) validates the mdimporter schema files provided as arguments and indicates whether the schema could be successfully parsed.
Not sure if this helps or not.
Good luck.
Hi Zax,
You might want to check out ExifTools. I used this to create an XMP library for a client. Often, metadata is embedded in picture files as plain text or UTF8. It may be quite simple to read this text from the picture file.
Best,
Mark
You might want to check out ExifTools. I used this to create an XMP library for a client. Often, metadata is embedded in picture files as plain text or UTF8. It may be quite simple to read this text from the picture file.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Thanks for your quick replies.
Unfortunately Obleo, I will have to use the soft from MacOSX *and* Windows (sorry, I should mention this point in my previous post).
Mark, could you give me some links for ExifTools (a quick Google search gave me many results concerning different ExifTools). In other hand, I'm not sure ExitTools could help me because you know all JPEG images doesn't always contain EXIF data.
Anyway, I'll try ExifTools as soon as I'll know where to download it.
Once again, thanks all for your help. This project is important for me (I already released a PHP version but now I have to release a standalone version).
Unfortunately Obleo, I will have to use the soft from MacOSX *and* Windows (sorry, I should mention this point in my previous post).
Mark, could you give me some links for ExifTools (a quick Google search gave me many results concerning different ExifTools). In other hand, I'm not sure ExitTools could help me because you know all JPEG images doesn't always contain EXIF data.
Anyway, I'll try ExifTools as soon as I'll know where to download it.
Once again, thanks all for your help. This project is important for me (I already released a PHP version but now I have to release a standalone version).
Hi Zax,
The first link in Google: http://www.sno.phy.queensu.ca/~phil/exiftool/
I haven't installed it btw. I include it with the standalone, in the externals folder, when use the complete path to the executable when calling it from the shell.
Best,
Mark
The first link in Google: http://www.sno.phy.queensu.ca/~phil/exiftool/
I haven't installed it btw. I include it with the standalone, in the externals folder, when use the complete path to the executable when calling it from the shell.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Huh ?
Mark, you make me feel like I'm a totally newbie
Maybe that's what I am in fact because I don't understand how could I use ExifTool without installing the package (of course, I don't want to install this package).
To be honnest, I also encouter some problem understanding ExifTool's documentation and it's not only due to the fact english is not my native language.
Mark, you make me feel like I'm a totally newbie

Maybe that's what I am in fact because I don't understand how could I use ExifTool without installing the package (of course, I don't want to install this package).
To be honnest, I also encouter some problem understanding ExifTool's documentation and it's not only due to the fact english is not my native language.
OK, I finally was able to retreive image date with ExifTool, but only when ExifTool is installed on my Mac.
Now, when I disinstall ExifTool and I try to add ExifTool as external in my rev stack, it says "/bin/sh: line 1: exiftool: command not found". At this time, my rev stack is still in development mode but I presume I don't have to make a standalone to have an external work.
I order to test, I wrote in the msg box "answer the externalFunctions of stack <MyStack> and it answers nothing (an empty string).
So I guess my problem came from declaring the external in my stack.
Now, when I disinstall ExifTool and I try to add ExifTool as external in my rev stack, it says "/bin/sh: line 1: exiftool: command not found". At this time, my rev stack is still in development mode but I presume I don't have to make a standalone to have an external work.
I order to test, I wrote in the msg box "answer the externalFunctions of stack <MyStack> and it answers nothing (an empty string).
So I guess my problem came from declaring the external in my stack.
Hi Zax,
The easiest way is probably to enter the entire path to the command line executable, instead of only its name.
put shell("<path to executable> exifCommands")
Best,
Mark
The easiest way is probably to enter the entire path to the command line executable, instead of only its name.
put shell("<path to executable> exifCommands")
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
I did locate shell info for windows on metadata at http://msdn.microsoft.com/en-us/library/bb643802.aspxZax wrote:Thanks for your quick replies.
Unfortunately Obleo, I will have to use the soft from MacOSX *and* Windows (sorry, I should mention this point in my previous post).
.
After seeing that library mark posted in action. I would guess that would be the best option. As it built with rev stack ready to use.
Hi, it's me again
I now encounter strange problem when writing the "put shell() command" with Windows (works with MacOS)
I tried:
1 - simple test and it works (ExifTool returns infos)
2 - test with space in MyExifPath and it still works (ExifTool still returns infos)
3 - test with space in MyExifPath and argument and it still works (ExifTool returns "no file specified")
4 - test with space in MyExifPath and MyImagePath with spaceThis doesn't work with Windows (Windows says ""C:/Path" is not a valid command) but works with MacOS.
The strange thing that if I type in the windows console, it works.
This make me mad
Any idea?

I now encounter strange problem when writing the "put shell() command" with Windows (works with MacOS)
I tried:
1 - simple test
Code: Select all
put shell("C:/MyExifPath/exiftool") into fld "Test"
2 - test with space in MyExifPath
Code: Select all
put shell(quote & "C:/My ExifPath/exiftool" & quote) into fld "Test"
3 - test with space in MyExifPath and argument
Code: Select all
put shell(quote & "C:/My ExifPath/exiftool" & quote && "-filetype") into fld "Test"
4 - test with space in MyExifPath and MyImagePath with space
Code: Select all
put shell(quote & "C:/My ExifPath/exiftool" & quote && quote & "C:/Path To My Image.jpg" & quote) into fld "Test"
The strange thing that if I type
Code: Select all
"C:/My ExifPath/exiftool" "C:/Path To My Image.jpg"
This make me mad

Any idea?
Hi Zax,
I know this can be very tricky. You might try the shortFilePath function, to replace the file paths you are currently using. This should avoid the space problem and is probably the easiest solution.
Best,
Mark
I know this can be very tricky. You might try the shortFilePath function, to replace the file paths you are currently using. This should avoid the space problem and is probably the easiest solution.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode