示例#1
0
 def topic(self, callback):
     self.test_data = TestData(
         source_width=800, source_height=600,
         target_width=400, target_height=150,
         halign="center", valign="middle",
         focal_points=[],
         crop_left=0, crop_top=75, crop_right=800, crop_bottom=375
     )
     context = self.test_data.to_context(detectors=[MockErrorSyncDetector], ignore_detector_error=False)
     trans = Transformer(context)
     trans.transform(callback)
示例#2
0
        def topic(self, callback):
            data = TestData(
                source_width=800, source_height=600,
                target_width=-800, target_height=-600,
                halign="right", valign="top",
                focal_points=[],
                crop_left=None, crop_top=None, crop_right=None, crop_bottom=None
            )

            ctx = data.to_context()
            self.engine = ctx.modules.engine

            trans = Transformer(ctx)
            trans.transform(callback)
示例#3
0
        def topic(self, callback):
            data = TestData(
                source_width=800, source_height=600,
                target_width=-800, target_height=-600,
                halign="right", valign="top",
                focal_points=[],
                crop_left=None, crop_top=None, crop_right=None, crop_bottom=None
            )

            ctx = data.to_context()
            ctx.request.filters = 'cover()'
            ctx.request.image = 'some.gif'
            ctx.request.extension= 'GIF'
            ctx.request.engine.extension = '.gif'
            ctx.config.USE_GIFSICLE_ENGINE = True

            self.engine = ctx.modules.engine

            trans = Transformer(ctx)
            trans.transform(callback)