views:

238

answers:

2

I saw that you can embed meta-data into images very much like you can in mp3s, here.

Can someone point me to a tutorial of how to embed and read this sort of information w/ photoshop and flex together? I really wouldn't know where to start... Tried googling but I'm not sure I have the right keywords down.

Thanks!

+1  A: 

Well AS3 don't have a built-in class to read jpg header.

BUT, if you are loading the image using URLLoader you can use the ByteArray to read if manually.

You can find the spec here: http://www.obrador.com/essentialjpeg/HeaderInfo.htm

If you need some tutorial of using Bytearray you can start from here: http://stackoverflow.com/questions/906791/how-to-convert-bytearray-to-image-or-image-to-bytearray

or here: http://digitalmedia.oreilly.com/pub/a/oreilly/digitalmedia/helpcenter/flex3cookbook/chapter8.html?page=7

The principle is the same -read the bytes, convert them to readable data using the spec above and use it.

Good luck!

yn2
Yikes. OK, I'll try that.
jml
+1  A: 

Photoshop (CS4+ I think) can also add XMP headers (XML style) which will be easier to parse than bytes but it contains different information.

http://code.google.com/p/exif-as3/

Here is a class that should do the job. It is non-commercial only but there is another option.

www.ultrashock.com/forums/server-side/extracting-metadata-from-photos-86065.html

Here is a php script that will do it that could be ported to as3 - it might be easier than creating one from scratch. If you did want php to read the info I would use the built in exif functions :)

pedro_sland
Cool library. I will definitely be checking this out... Yeah, I had heard about the built in EXIF functions of php- I get the feeling that this would ultimately be more clean and quick to load.
jml