コード例 #1
0
ファイル: imagespecs.py プロジェクト: jgblight/Intrepid
 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)
     ]
コード例 #2
0
 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),
     ]
コード例 #3
0
ファイル: imagegenerators.py プロジェクト: exclude/monki
    def processors(self):
        model, field_name = get_field_info(self.source)

        size = (225, 175)

        return [
            ResizeToFit(*size),
        ]
コード例 #4
0
ファイル: models.py プロジェクト: DarcyMyers/gobotany-app
 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),
     ]
コード例 #5
0
ファイル: imagespecs.py プロジェクト: jgblight/Intrepid
 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))
     ]
コード例 #6
0
ファイル: specs.py プロジェクト: Siyet/ccp
    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)
        ]
コード例 #7
0
ファイル: imagespecs.py プロジェクト: jgblight/Intrepid
 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),
         )
     ]
コード例 #8
0
	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)
コード例 #9
0
    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)
コード例 #10
0
ファイル: models.py プロジェクト: enjieli/gobotany-app
    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),
        ]
コード例 #11
0
ファイル: models.py プロジェクト: newfs/gobotany-app
    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),
        ]
コード例 #12
0
ファイル: imagespecs.py プロジェクト: jgblight/Intrepid
 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)]
コード例 #13
0
ファイル: imagespecs.py プロジェクト: jgblight/Intrepid
 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)]
コード例 #14
0
ファイル: models.py プロジェクト: shangsunset/joyceful
 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)]
コード例 #15
0
ファイル: models.py プロジェクト: shangsunset/joyceful
 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)]
コード例 #16
0
ファイル: models.py プロジェクト: DrCBeatz/django_projects
 def processors(self):
     model, field_name = get_field_info(self.source)
     return [ResizeToFill(600, 600, anchor=model.anchor)]
コード例 #17
0
ファイル: models.py プロジェクト: wengole/comiccollector
 def processors(self):
     model, field_name = get_field_info(self.source)
     return [processors.Crop(model.width, model.width, anchor=processors.Anchor.TOP)]
コード例 #18
0
ファイル: imagespecs.py プロジェクト: jgblight/Intrepid
 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)]
コード例 #19
0
ファイル: generateimages.py プロジェクト: finleysg/aimee
 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)]
コード例 #20
0
 def processors(self):
     model, field_name = get_field_info(self.source)
     return [ResizeToFill(model.width, model.height)]
コード例 #21
0
ファイル: processors.py プロジェクト: strizhas/hiddenhistory
 def processors(self):
     model, field_name = get_field_info(self.source)
     return [RotateEXIF(model.orientation), ResizeToFill(200, 130)]
コード例 #22
0
ファイル: models.py プロジェクト: piwonskp/grzebyk
 def processors(self):
     model, field_name = get_field_info(self.source)
     return [ResizeToFill(model.THUMB_WIDTH, model.THUMB_HEIGHT)]
コード例 #23
0
ファイル: models.py プロジェクト: akbar22/sunflower
 def processors(self):
     model, field = get_field_info(self.source)
     return [ResizeToFit(400)]
コード例 #24
0
ファイル: processors.py プロジェクト: strizhas/hiddenhistory
 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)]