Exemplo n.º 1
0
def should_create_thumbnail(file_path):
    image = storage.open(file_path)
    try:
        Image.open(image)
    except IOError:
        return False
    else:
        return utils.is_valid_image_extension(file_path)
def should_create_thumbnail(file_path):
    image_from_url = cStringIO.StringIO(urllib.urlopen(file_path).read())
    try:
        Image.open(image_from_url)
    except IOError:
        return False
    else:
        return utils.is_valid_image_extension(file_path)
Exemplo n.º 3
0
def should_create_thumbnail(file_path):
    image = default_storage.open(file_path)
    try:
        Image.open(image)
    except IOError:
        return False
    else:
        return utils.is_valid_image_extension(file_path)
Exemplo n.º 4
0
 def is_image(self):
     return utils.is_valid_image_extension(self.file_object.name)
 def is_image(self):
     return utils.is_valid_image_extension(self.file_object.name)
Exemplo n.º 6
0
def image_verify(file_object):
    if not utils.is_valid_image_extension(file_object.name):
        raise utils.NotAnImageException