Page 1 of 1
Reading basic png metadata
Posted: Sun Jul 09, 2017 6:47 am
by bidgeeman
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
Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 8:56 am
by richmond62
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

Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 9:10 am
by richmond62
"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.
Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 9:19 am
by bidgeeman
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
Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 9:37 am
by richmond62
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.
Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 9:39 am
by richmond62
reasonably easy
Don't say that to me: say that to the people in Edinburgh . . .

Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 9:39 am
by bidgeeman
LOL...yes ...I read that metadata consists only of density

I was hoping that "Image Details" might be different to metadata.
Bidge
Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 9:49 am
by richmond62
TIME FOR AN ENHANCEMENT REQUEST
BUG 20025
Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 9:51 am
by bidgeeman
That gets my vote

Bidge
Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 8:35 pm
by Klaus
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
Re: Reading basic png metadata
Posted: Sun Jul 09, 2017 8:41 pm
by richmond62
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

Re: Reading basic png metadata
Posted: Mon Jul 10, 2017 12:56 pm
by MaxV
Contact Sunny, he is an expert of Images and Livecode:
https://sunny-tdz.com/livecode/sunnymage
Re: Reading basic png metadata
Posted: Mon Jul 10, 2017 9:06 pm
by [-hh]
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:
Code: Select all
put exifProcessFile(theData, true) into allTags
For any already available image "X" use
Code: Select all
put exifProcessFile(the text of image "X", true) into allTags