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)
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)
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