def _simple_png(): """Create a 1x1 black png in memory.""" image_file = BytesIO() image = Image.new('RGBA', (1, 1)) image.save(image_file, 'png') image_file._committed = True image_file.name = 'test.png' image_file.url = '{0}/{1}'.format(TEST_SERVER, image_file.name) image_file.seek(0) return image_file
def simple_png(): """Create a 1x1 black png in memory and return a handle to it.""" image_file = BytesIO() image = Image.new('RGBA', (1, 1)) image.save(image_file, 'png') image_file.name = 'test.png' image_file.url = 'http://testserver' + image_file.name image_file._committed = True image_file.seek(0) return image_file
def simple_png(): """Create a 1x1 black png in memory and return a handle to it.""" image_file = BytesIO() image = Image.new('RGBA', (1, 1)) image.save(image_file, 'png') image_file.name = 'test.png' image_file.url = '{0}/{1}'.format( TEST_SERVER, image_file.name, ) image_file._committed = True image_file.seek(0) return image_file