Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am bibzz on github.
  • I am bibzz (https://keybase.io/bibzz) on keybase.
  • I have a public key ASAgIaqDA072oE5XLasGRRmymFlvjsxBa8qPDfJQSLS-7Qo

To claim this, I am signing this object:

@BiBzz
BiBzz / svgimagefield.py
Last active February 15, 2020 23:44 — forked from ambivalentno/svgimagefield.py
A form field to handle validation of image + svg.
import sys
from io import BytesIO
from PIL import Image
import xml.etree.cElementTree as et
from django.core.exceptions import ValidationError
from django.core import validators
from django.forms import ImageField as DjangoImageField
from django.utils import six