Add photo.transform support and testcase.

This commit is contained in:
sneakypete81 2012-09-10 23:57:42 +01:00
parent b900b2abd3
commit 4147029b14
3 changed files with 38 additions and 6 deletions

View file

@ -89,4 +89,13 @@ class ApiPhoto:
return photo.next_previous(**kwds)
def transform(self, photo, **kwds):
raise NotImplementedError()
"""
Performs transformation specified in **kwds
Example: transform(photo, rotate=90)
"""
if not isinstance(photo, Photo):
photo = Photo(self._client, {"id": photo})
photo.transform(**kwds)
# The API doesn't currently return the transformed photo
# Uncomment the below once frontend issue #955 is resolved
# return photo