0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Wagtailimages: Test image is now created on the fly

This commit is contained in:
Karl Hobley 2014-02-23 14:58:04 +00:00
parent 451f133d3b
commit f565f4b79b
2 changed files with 8 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -8,7 +8,14 @@ from wagtail.wagtailimages.templatetags import image_tags
def get_test_image_file():
return 'wagtail/wagtailimages/static/wagtailimages/images/test.png'
from StringIO import StringIO
from PIL import Image
from django.core.files.images import ImageFile
f = StringIO()
image = Image.new('RGB', (640, 480), 'white')
image.save(f, 'PNG')
return ImageFile(f, name='test.png')
Image = get_image_model()