File: utils.py

package info (click to toggle)
pilkit 1.1.13%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 504 kB
  • ctags: 239
  • sloc: python: 834; makefile: 130
file content (19 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os
from pilkit.lib import Image


def get_image_file():
    """
    See also:

    http://en.wikipedia.org/wiki/Lenna
    http://sipi.usc.edu/database/database.php?volume=misc&image=12

    """
    dir = os.path.dirname(__file__)
    path = os.path.join(dir, 'assets', 'reference.png')
    return open(path, 'r+b')


def create_image():
    return Image.open(get_image_file())