def processors(self): model, field_name = get_field_info(self.source) min_dim = min(model.original.width, model.original.height) return [ SmartCrop(width=min_dim, height=min_dim), ResizeToFill(width=500, height=500) ]
def processors(self): """ Dynamically create the list of image processors using the model instance. """ instance, field_name = get_field_info(self.source) return [ ExifGpsExtractor(instance), ResizeToFit(1000, 1000, False), ]
def processors(self): model, field_name = get_field_info(self.source) size = (225, 175) return [ ResizeToFit(*size), ]
def processors(self): model, field_name = get_field_info(self.source) min_dim = min(model.image_file.width, model.image_file.height) return [ Crop(width=min_dim, height=min_dim, x=int(-1 * model.image_x * model.image_file.width), y=int(-1 * model.image_y * model.image_file.height)) ]
def processors(self): instance, field_name = get_field_info(self.source) cache = instance.cache.filter( resolution=CACHE_RESOLUTION.preview).first() if not cache or not path.isfile(cache.file.path): return [] return [ ComposeSample(cache.file.path, instance.needs_shadow), ResizeToFit(*self.size) ]
def processors(self): model, field_name = get_field_info(self.source) min_dim = min(model.image_file.width, model.image_file.height) return [ Crop( width=min_dim, height=min_dim, x=int(-1 * model.image_x * model.image_file.width), y=int(-1 * model.image_y * model.image_file.height), ) ]
def __init__(self, source, specs): instance, attname = get_field_info(source) self.specs = specs #Apply specs to instance for attr_name in specs: setattr(self, attr_name, specs[attr_name]) self.source = source self.instance = instance self.attname = attname self.init_processors() super(InstanceSpec, self).__init__(source)
def processors(self): """ Dynamically create the list of image processors using the model instance. """ # August 2018: found that this code no longer seems to be # able to produce a model instance as it must have in the past. # When this happens, the ExifGpsExtractor image processor below # cannot save any extracted latitude or longitude coordinates. # TODO: debug and resolve, or else extract and save coordinates # another way (such as client side). print(('processors(): self.source:', self.source)) print(('processors(): type(self.source):', type(self.source))) instance, field_name = get_field_info(self.source) print(('processors() instance:', instance)) print(('processors() field_name:', field_name)) return [ ExifGpsExtractor(instance), ResizeToFit(1000, 1000, False), ]
def processors(self): """ Dynamically create the list of image processors using the model instance. """ # August 2018: found that this code no longer seems to be # able to produce a model instance as it must have in the past. # When this happens, the ExifGpsExtractor image processor below # cannot save any extracted latitude or longitude coordinates. # TODO: debug and resolve, or else extract and save coordinates # another way (such as client side). print 'processors(): self.source:', self.source print 'processors(): type(self.source):', type(self.source) instance, field_name = get_field_info(self.source) print 'processors() instance:', instance print 'processors() field_name:', field_name return [ ExifGpsExtractor(instance), ResizeToFit(1000, 1000, False), ]
def processors(self): model, field_name = get_field_info(self.source) crop_width = int(model.original.width) crop_height = min(model.original.height, int(crop_width * 3.0 / 5.0)) return [SmartCrop(width=crop_width, height=crop_height)]
def processors(self): model, field_name = get_field_info(self.source) min_dim = min(model.original.width, model.original.height) return [SmartCrop(width=min_dim, height=min_dim), ResizeToFill(width=500, height=500)]
def processors(self): model, field_name = get_field_info(self.source) if model.image.height > model.image.width: return [ResizeToFill(250, 352)] else: return [ResizeToFill(250, 169)]
def processors(self): model, field_name = get_field_info(self.source) # return [ResizeToFill(model.album_cover.width/3, # model.album_cover.height/3)] return [ResizeToFill(800, 600)]
def processors(self): model, field_name = get_field_info(self.source) return [ResizeToFill(600, 600, anchor=model.anchor)]
def processors(self): model, field_name = get_field_info(self.source) return [processors.Crop(model.width, model.width, anchor=processors.Anchor.TOP)]
def processors(self): model, field_name = get_field_info(self.source) color = convert_to_rgb(model.watermark_color) return [Watermark(text=COPY_WRITE, color=color), ResizeToFit(600, 600)]
def processors(self): model, field_name = get_field_info(self.source) return [ResizeToFill(model.width, model.height)]
def processors(self): model, field_name = get_field_info(self.source) return [RotateEXIF(model.orientation), ResizeToFill(200, 130)]
def processors(self): model, field_name = get_field_info(self.source) return [ResizeToFill(model.THUMB_WIDTH, model.THUMB_HEIGHT)]
def processors(self): model, field = get_field_info(self.source) return [ResizeToFit(400)]
def processors(self): model, field_name = get_field_info(self.source) if model.img.width > 800: return [RotateEXIF(model.orientation), ResizeToFit(1280, 700)] else: return [RotateEXIF(model.orientation)]