From cb9f943e4ee600fc397c2e04479c701b98fb3bd4 Mon Sep 17 00:00:00 2001 From: Anthony Cintron Date: Fri, 16 Mar 2012 13:23:54 -0300 Subject: [PATCH] Set width/height to self.width/self.height in map_to_dictionary. This allows us to use width/height in html() when call render_html. It also adheres to the VideoProvider example, which was broken prior to this fix. --- oembed/providers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oembed/providers.py b/oembed/providers.py index 455bc6d..73d6524 100644 --- a/oembed/providers.py +++ b/oembed/providers.py @@ -534,13 +534,13 @@ def map_to_dictionary(self, url, obj, **kwargs): if self.resource_type == 'photo' and self.get_image(obj): self.resize_photo(obj, mapping, maxwidth, maxheight) elif self.resource_type in ('video', 'rich', 'photo'): - width, height = size_to_nearest( + self.width, self.height = size_to_nearest( maxwidth, maxheight, self._meta.valid_sizes, self._meta.force_fit ) - mapping.update(width=width, height=height) + mapping.update(width=self.width, height=self.height) # create a thumbnail if self.get_image(obj):