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 | #check if the fields have proper values |
| 28 | if isinstance(width,int) and isinstance(height,int): |
| 29 | self._dimensions_cache = (width, height) |
| 30 | else: |
| 31 | self._dimensions_cache = get_image_dimensions(self) |
| 32 | else: |
| 33 | self._dimensions_cache = get_image_dimensions(self) |