get_original_metadata working?

382 views
Skip to first unread message

martinc

unread,
Jul 23, 2011, 6:05:03 PM7/23/11
to google-a...@googlegroups.com

Has anyone gotten the new get_original_metadata to work?


I've been testing it on production with jpegs from an iPhone with EXIF data and getting a response of None, wonder if the service hasn't been fully enabled yet.


-Martin

Ed Estes

unread,
Jul 25, 2011, 1:02:40 PM7/25/11
to google-a...@googlegroups.com
I too am interested in get_original_metadata calls to pull metadata from photos.  I haven't seen any updates to the docs to reflect what came out with GAE 1.5.2 SDK.

Any confirmation/assistance with this would be greatly appreciated.

Thanks!

--Ed

Martin Ceperley

unread,
Jul 25, 2011, 5:10:14 PM7/25/11
to google-a...@googlegroups.com
Hi Ed,

I looked at the source and it is just an instance method of the images.Image class, called with no parameters, i.e. image.get_original_metadata()

I'm stilling getting None from the method, I have tried it both by instantiating an Image from a blob_key and directly with image data, in both cases get_original_metadata returned None so it appears not to be working at all.

-Martin

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/xgtDUMIzDTQJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Ed Estes

unread,
Jul 25, 2011, 7:34:14 PM7/25/11
to google-a...@googlegroups.com
Thanks for confirming this.  I was calling it the same way (similar to the histogram method) but since I wasn't seeing any data (it was also returning None), I thought I was not calling get_original_metadata properly.

I was using some of the sample photos found over on exif.org.

Hopefully someone will clarify things shortly.

--Ed

Ed Estes

unread,
Aug 9, 2011, 1:32:13 PM8/9/11
to google-a...@googlegroups.com
Any updates on this?  With App Engine 1.5.3 Pre-release being announced, I was hoping someone would acknowledge get_original_metadata was broken and was being addressed in the next release.

--Ed

Martin Ceperley

unread,
Aug 9, 2011, 1:43:35 PM8/9/11
to google-a...@googlegroups.com
Hi Ed,

I've been discussing this with Jose, and have made a little progress but still have not successfully lat/long exif data out of JPG's.

He told me that in order to get a value other than None, execute_transforms() must be called on the image object. So, if you have no transformations, you can do a rotate of 0 degrees, and then call execute_transforms, and then get_orginal_metadata.

With this I am simply getting the function to return this dict: {u'MimeType': 0, u'ImageLength': 1536, u'ImageWidth': 2048} 

But none of the EXIF data. Let us know if you have any more luck.

-Martin
 


On Aug 9, 2011, at 12:32 PM, Ed Estes wrote:

Any updates on this?  With App Engine 1.5.3 Pre-release being announced, I was hoping someone would acknowledge get_original_metadata was broken and was being addressed in the next release.

--Ed

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/VmyGIPBX85oJ.

Ed Estes

unread,
Aug 9, 2011, 2:48:20 PM8/9/11
to google-a...@googlegroups.com
Thanks for the pointer Martin.  By adding the lines of code before calling get_original_metadata:

orgImg.rotate(0)
orgImg.execute_transforms()
orgImg.get_original_metadata()

I am able to get the following data EXIF data now:

{u'ImageLength': 480, u'ImageWidth': 640}

but that really doesn't help since the width/height are exposed properties in the image class already.

If there is anything I can do to help with this, just let me know.

Thanks.

--Ed

Gyuri Dorko

unread,
Aug 9, 2011, 9:42:47 PM8/9/11
to google-a...@googlegroups.com
You have to call execute_transform with parse_metadata=True.
App Engine will document the feature soon. I understand you are very much interested in trying it out, so you can just use the docstring from the SDK api/images/__init__.py to understand what is the return value of get_original_metadata.
-- 
Gyuri

Ed Estes

unread,
Aug 10, 2011, 9:42:09 AM8/10/11
to google-a...@googlegroups.com
Got it.  Now when I execute:

orgImg = images.Image(image_data)
orgImg.rotate(0)
orgImg.execute_transforms(parse_source_metadata=True)
self.response.out.write(orgImg.get_original_metadata())

I do get a larger subset of EXIF data from my app when it's running on GAE server!

Martin,

I don't know what the timing is for get_original_metadata to return GPS information, but I was able to get a third-party EXIF library running on GAE last night. (and I am seeing long/lat data if it exists) I can share how I did that with you if you are interested in it short-term as a stop gap solution as get_original_metadata improves over time.

--Ed

Gyuri Dorko

unread,
Aug 10, 2011, 10:18:21 AM8/10/11
to google-a...@googlegroups.com
I have just checked with an image with GPS info and I correctly got back the EXIF. The lat/long info are in the dictionary with keys GPSLatitude and GPSLongitude.
If this doesn't work for you, please send a link to the image in question and I can look into. In general it should work with images that have detected location in PicasaWeb or Panoramio after upload.

-- 
Gyuri

Ed Estes

unread,
Aug 10, 2011, 11:30:04 AM8/10/11
to google-a...@googlegroups.com
Gyuri,

You are absolutely correct.  I made a bad assumption based on Martin's statement about still have not successfully lat/long exif data out of JPG's and my own initial results.  The production photos I was looking at the results from get_original_metadata calls ironically enough didn't contain GPS data so I incorrectly assumed they were tagged and it wasn't being returned.  (and as documented, running things locally doesn't yet produce the full EXIF results)

I have uploaded some images into production that I know have GPS data and I am able to get everything!  Even better, you've taken the time to convert the hours, minutes, seconds and direction format to something I can easily store and use with Google Maps. Rock on!

Thanks for taking the time to respond and clear up the confusion.

--Ed

PandaSuit

unread,
Aug 10, 2011, 3:48:34 PM8/10/11
to Google App Engine
Thanks for letting us know about the parse_metadata flag. This is
really useful. I should be able to use this to figure out if an image
is CMYK. Any plans to let us modify the metadata? :)

Vinuth Madinur

unread,
Aug 11, 2011, 4:15:18 PM8/11/11
to google-a...@googlegroups.com
I there a noop execute_transform? a rotate(0) is taking exactly 5 seconds for a 110kb image (2 megapixels) and throwing a TransformationError exception.

Any help would be very much appreciated.

Thanks,
Vinuth.


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.

Vinuth Madinur

unread,
Aug 11, 2011, 8:37:04 PM8/11/11
to google-a...@googlegroups.com
There seems to be some problem with Image API. execute_transform() is failing for all images. Works fine on SDK.

Anybody else facing this?

Thanks,
Vinuth.

Nadun Kulatunge

unread,
Aug 12, 2011, 5:53:18 AM8/12/11
to google-a...@googlegroups.com
hey click this URL http://adf.ly/29lnM <http://adf.ly/29lnM> it will help you
check in
--
Bye TC

Ed Estes

unread,
Aug 12, 2011, 7:05:48 AM8/12/11
to google-a...@googlegroups.com
Yes, something is definitely going on with GAE - I am getting timeouts/failures as well and it worked on Wednesday.  Other threads are mentioning problems with slow response times so there appears to be something more going on system wide.

--Ed

Ed Estes

unread,
Aug 13, 2011, 10:26:35 AM8/13/11
to google-a...@googlegroups.com
OK, it's been a few days and this hasn't been resolved so I opened up a bug report for it.  Please vote on this bug so it gets some attention.

Thanks!

--Ed
Reply all
Reply to author
Forward
0 new messages