コード例 #1
0
ファイル: copy_images.py プロジェクト: acaciawater/iom
def copy(url):
    if url:
        filename = os.path.basename(url)
        Exif.copyImage(url, os.path.join(settings.PHOTO_DIR,filename))
        return (os.path.join(settings.PHOTO_URL, filename), True)
    else:
        return (url, False)
コード例 #2
0
def copy(url):
    if url:
        filename = os.path.basename(url)
        Exif.copyImage(url, os.path.join(settings.PHOTO_DIR, filename))
        return (os.path.join(settings.PHOTO_URL, filename), True)
    else:
        return (url, False)
コード例 #3
0
def download_photo(url):
    # copy photo to local storage and rotate if necessary
    try:
        filename = os.path.basename(url)
        Exif.copyImage(url, os.path.join(settings.PHOTO_DIR,filename))
        return os.path.join(settings.PHOTO_URL,filename)
    except:
        return url
コード例 #4
0
ファイル: import_akvo.py プロジェクト: acaciawater/iom
def download_photo(url):
    # copy photo to local storage and rotate if necessary
    try:
        filename = os.path.basename(url)
        Exif.copyImage(url, os.path.join(settings.PHOTO_DIR,filename))
        return os.path.join(settings.PHOTO_URL,filename)
    except:
        return url