mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-17 19:51:11 +00:00
16 lines
439 B
Python
16 lines
439 B
Python
from imagekit import ImageSpec, register
|
|
from imagekit.processors import ResizeToFill
|
|
|
|
|
|
class TestSpec(ImageSpec):
|
|
pass
|
|
|
|
|
|
class ResizeTo1PixelSquare(ImageSpec):
|
|
def __init__(self, width=None, height=None, anchor=None, crop=None, **kwargs):
|
|
self.processors = [ResizeToFill(1, 1)]
|
|
super(ResizeTo1PixelSquare, self).__init__(**kwargs)
|
|
|
|
|
|
register.spec('testspec', TestSpec)
|
|
register.spec('1pxsq', ResizeTo1PixelSquare)
|