versatileimagefield/utils.py
def get_resized_filename(filename, width, height, filename_key):
    """
    Return the 'resized filename' (according to `width`, `height` and
    `filename_key`) in the following format:
    `filename`-`filename_key`-`width`x`height`.ext
    """
    try:
        image_name, ext = filename.rsplit('.', 1)
    except ValueError:
        image_name = filename
        ext = 'jpg'

    resized_template = "%(filename_key)s-%(width)dx%(height)d"
    if ext.lower() in ['jpg', 'jpeg']:
        resized_template = resized_template + "-%(quality)d"

    resized_key = resized_template % ({
        'filename_key': filename_key,
        'width': width,
        'height': height,
        'quality': QUAL
    })

    return "%(image_name)s-%(image_key)s.%(ext)s" % ({
        'image_name': image_name,
        'image_key': post_process_image_key(resized_key),
        'ext': ext
    })
def get_resized_filename(filename, width, height, filename_key):
    """
    Return the 'resized filename' (according to `width`, `height` and
    `filename_key`) in the following format:
    `filename`-`filename_key`-`width`x`height`.ext
    """
    try:
        image_name, ext = filename.rsplit('.', 1)
    except ValueError:
        image_name = filename
        ext = 'jpg'

    resized_template = "%(filename_key)s-%(width)dx%(height)d"
    if ext.lower() in ['jpg', 'jpeg']:
        resized_template = resized_template + "-%(quality)d"

    resized_key = resized_template % ({
        'filename_key': filename_key,
        'width': width,
        'height': height,
        'quality': QUAL
    })

    return "%(image_name)s-%(image_key)s.%(ext)s" % ({
        'image_name': image_name,
        'image_key': post_process_image_key(resized_key),
        'ext': ext
    })
def get_resized_filename ( filename , width , height , filename_key ) : try : image_name , ext = filename . rsplit ( '.' , 1 ) except ValueError : image_name = filename ext = 'jpg' resized_template = "%(filename_key)s-%(width)dx%(height)d" if ext . lower ( ) in [ 'jpg' , 'jpeg' ] : resized_template = resized_template + "-%(quality)d" resized_key = resized_template % ( { 'filename_key' : filename_key , 'width' : width , 'height' : height , 'quality' : QUAL } ) return "%(image_name)s-%(image_key)s.%(ext)s" % ( { 'image_name' : image_name , 'image_key' : post_process_image_key ( resized_key ) , 'ext' : ext } )
Return the 'resized filename' (according to `width`, `height` and
    `filename_key`) in the following format:
    `filename`-`filename_key`-`width`x`height`.ext
Return the resized filename ( according to width height and filename_key ) in the following format : filename - filename_key - width x height . ext