Ticket #8307: images.py.diff

File images.py.diff, 801 bytes (added by anonymous, 11 years ago)
  • core/files/images.py

     
    2121
    2222    def _get_image_dimensions(self):
    2323        if not hasattr(self, '_dimensions_cache'):
    24             self._dimensions_cache = get_image_dimensions(self)
     24            if self.field.width_field and self.field.height_field:
     25                width = getattr(self.instance, self.field.width_field)
     26                height = getattr(self.instance, self.field.height_field)
     27                self._dimensions_cache = (width, height)
     28            else:
     29                self._dimensions_cache = get_image_dimensions(self)
    2530        return self._dimensions_cache
    2631
    2732def get_image_dimensions(file_or_path):
Back to Top