Esempio n. 1
0
def img(width=0, height=0, ext=''):
    try:
        im = pcutils.simple_resize(width, height, ROOT_DIR + '/static/' + DEFAULT_GALLERY + '/default.jpg')
        response = pcutils.get_extension_response(im, ext)
        return response
    except IOError, ioe:
        return make_response('An error occurred.  Sorry.')
Esempio n. 2
0
def imgar_gallery(gallery, width, height, ext=''):
    """ Find the most appropriate aspect ratio corgi, fit it to the new size, and then crop nicely. """
    im = pcutils.super_fit(width, height, ROOT_DIR + '/static/' + gallery + '/*')
    if im is None:
        return make_response('An error occurred.  You probably specified an invalid gallery.')
    im = pcutils.additional_image_mangling(im, request.args)
    response = pcutils.get_extension_response(im, ext)
    return response