Example #1
0
 def _compute_images(self):
     for record in self:
         images = tools.image_get_resized_images(record.image_original, big_name=False)
         record.image_big = tools.image_get_resized_images(record.image_original,
             large_name=False, medium_name=False, small_name=False, preserve_aspect_ratio=True)['image']
         record.image_large = images['image_large']
         record.image_medium = images['image_medium']
         record.image_small = images['image_small']
         record.can_image_be_zoomed = tools.is_image_size_above(record.image_original)
Example #2
0
 def _compute_images(self):
     for record in self:
         images = tools.image_get_resized_images(record.image_raw_original, big_name=False)
         record.image_raw_big = tools.image_get_resized_images(record.image_raw_original,
             large_name=False, medium_name=False, small_name=False)['image']
         record.image_raw_large = images['image_large']
         record.image_raw_medium = images['image_medium']
         record.image_raw_small = images['image_small']
         record.can_image_raw_be_zoomed = tools.is_image_size_above(record.image_raw_original)
Example #3
0
 def _compute_images(self):
     for record in self:
         image = record.image_raw_original
         # for performance: avoid calling unnecessary methods when falsy
         images = image and tools.image_get_resized_images(image, big_name=False)
         record.image_raw_big = image and tools.image_get_resized_images(image,
             large_name=False, medium_name=False, small_name=False)['image']
         record.image_raw_large = image and images['image_large']
         record.image_raw_medium = image and images['image_medium']
         record.image_raw_small = image and images['image_small']
         record.can_image_raw_be_zoomed = image and tools.is_image_size_above(image)
Example #4
0
 def _compute_can_image_variant_1024_be_zoomed(self):
     for record in self:
         record.can_image_variant_1024_be_zoomed = record.image_variant_1920 and tools.is_image_size_above(
             record.image_variant_1920, record.image_variant_1024)
Example #5
0
 def _compute_can_image_1024_be_zoomed(self):
     for image in self:
         image.can_image_1024_be_zoomed = image.image_1920 and tools.is_image_size_above(image.image_1920, image.image_1024)