Пример #1
0
    def post_process(self, im):
        try:
            content = default_storage.open(str(self.image)).read()
            mark = PILImage.open(BytesIO(content))
        except IOError as e:
            raise e

        return apply_watermark(im, mark, self.style, self.opacity)
Пример #2
0
    def post_process(self, im):
        try:
            content = default_storage.open(unicode(self.image)).read()
            mark = PILImage.open(StringIO(content))
        except IOError as e:
            raise e

        return apply_watermark(im, mark, self.style, self.opacity)