Reading basic png metadata
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Reading basic png metadata
Hello.
Is there a way to read basic metadata from a png image like the image information or creator information that you can access when you open an image in a paint program like paintshop pro etc or even the basic details you can access when you right click, properties?
Thanks
Bidge
Is there a way to read basic metadata from a png image like the image information or creator information that you can access when you open an image in a paint program like paintshop pro etc or even the basic details you can access when you right click, properties?
Thanks
Bidge
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Reading basic png metadata
Knowing NOTHING about metadata I cracked open a PNG image with a text editor and also looked here:
https://en.wikipedia.org/wiki/Portable_Network_Graphics
All the data (whether metadata or just the encoding on the image) is accessible; the only snag is it is in
a format that I, at least, don't understand.
HOWEVER: it is easy to separate the image data from the metadata insofar as everything that comes
between IDAT and IEND is the image data.
{parenthetically
this looks informative: http://fotoforensics.com/tutorial-meta.php }
https://en.wikipedia.org/wiki/Exif
Sorry; got to run: am doing diagrams for my wife's book on Historical Linguistics: back on this topic as soon as possible
https://en.wikipedia.org/wiki/Portable_Network_Graphics
All the data (whether metadata or just the encoding on the image) is accessible; the only snag is it is in
a format that I, at least, don't understand.
HOWEVER: it is easy to separate the image data from the metadata insofar as everything that comes
between IDAT and IEND is the image data.
{parenthetically

https://en.wikipedia.org/wiki/Exif
Sorry; got to run: am doing diagrams for my wife's book on Historical Linguistics: back on this topic as soon as possible

-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Reading basic png metadata
"The derivation of Exif from the TIFF file structure using offset pointers in the files means that data can be spread anywhere within a file"
this makes things very difficult indeed, as one cannot just open an image as text into a textField and
"chop and change" to isolate the metaData from the imageData rather like the way I worked out
how to import Inkscape SVG images into an SVG widget in LiveCode.
this makes things very difficult indeed, as one cannot just open an image as text into a textField and
"chop and change" to isolate the metaData from the imageData rather like the way I worked out
how to import Inkscape SVG images into an SVG widget in LiveCode.
Re: Reading basic png metadata
Hi richmond62.
You would think that a right click/image properties would be a reasonably easy thing to access seeing the data was put there in the first place to be accessed?
Cheers
Bidge
You would think that a right click/image properties would be a reasonably easy thing to access seeing the data was put there in the first place to be accessed?
Cheers
Bidge
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Reading basic png metadata
Ha, Ha, Ha: egg all over my face:
Check out metadata of image in the Documentation . . . .
Not much use as all one ends up with is the density.
Check out metadata of image in the Documentation . . . .
Not much use as all one ends up with is the density.
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Reading basic png metadata
Don't say that to me: say that to the people in Edinburgh . . .reasonably easy

Re: Reading basic png metadata
LOL...yes ...I read that metadata consists only of density
I was hoping that "Image Details" might be different to metadata.
Bidge

Bidge
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Reading basic png metadata
ENHANCEMENT REQUEST
BUG 20025
TIME FOR AN
BUG 20025
Re: Reading basic png metadata
That gets my vote 
Bidge

Bidge
Re: Reading basic png metadata
Hi all,
FYI: Mark Waddingham posted this on the use-lc mailing-list:
...
There's a livecodescript library which manipulates exif data:
https://github.com/angerangel/livecodeExif
...
Best
Klaus
FYI: Mark Waddingham posted this on the use-lc mailing-list:
...
There's a livecodescript library which manipulates exif data:
https://github.com/angerangel/livecodeExif
...
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Reading basic png metadata
Indeed: I saw that post: downloaded the zip file and then
found I couldn't work out how to use it in the way one uses imageData in Livecode
found I couldn't work out how to use it in the way one uses imageData in Livecode

Re: Reading basic png metadata
Contact Sunny, he is an expert of Images and Livecode: https://sunny-tdz.com/livecode/sunnymage
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
Re: Reading basic png metadata
The imageData of an image is the binary ARGB data, without EXIF.
The text of the image (or the contents of an image file) contains also the EXIF data, if there is any.
The zip by angerangel contains a demostack (the file, that ends in ".livecode").
The demostack contains a button "Test", that shows how to use the lib.
The script of that button contains a line that uses data from an image file:
For any already available image "X" use
The text of the image (or the contents of an image file) contains also the EXIF data, if there is any.
The zip by angerangel contains a demostack (the file, that ends in ".livecode").
The demostack contains a button "Test", that shows how to use the lib.
The script of that button contains a line that uses data from an image file:
Code: Select all
put exifProcessFile(theData, true) into allTags
Code: Select all
put exifProcessFile(the text of image "X", true) into allTags
shiftLock happens