I have a general purpose file storage backed by Google App Engine Blobstore, when I show users it’s contents I would like to differentiate images from other files — I would like to show thumbnail for each image.
Python get_serving_url function does not care (at least at dev server) if given blob is in fact an image, java’s getServingUrl throws en exception…
So my question, is: How to detect in python if a blob store entry is an image, so I could get a serving_url and use it in the UI?
EDIT:
On production python is throwing NotImageError on get_serving_url call with not supported blob—it’s just not documented and it does not do that on dev server.
You could putting the call inside a try…except block, catching the exception which is thrown when the object is found to not be an image.