GustavePate / lycheesync

a command line interface tool to sync lychee with any directory containing photos
108 stars 37 forks source link

Add option to mark import directory as read-only #60

Open tribut opened 8 years ago

tribut commented 8 years ago

When the directory lycheesyncer imports from is read-only and -l is used, importing of photos with wrong rotation fails:

ERROR;2016-04-24 17:06:35,232; lycheesync.lycheesyncer; [Errno 13] Permission denied: '/srv/vhosts/lychee/uploads/big/e59e6b335a07d61f8fde932d84a01906.jpg'
Traceback (most recent call last):
  File "/home/www-lychee/lycheesync/lycheesync/lycheesyncer.py", line 422, in sync
    self.adjustRotation(photo)
  File "/home/www-lychee/lycheesync/lycheesync/lycheesyncer.py", line 250, in adjustRotation
    img.save(photo.destfullpath, exif=exif_bytes, quality=99)
  File "/home/www-lychee/lycheesync/venv/lib/python3.4/site-packages/PIL/Image.py", line 1659, in save
    fp = builtins.open(filename, "wb")
PermissionError: [Errno 13] Permission denied: '/srv/vhosts/lychee/uploads/big/e59e6b335a07d61f8fde932d84a01906.jpg'
ERROR;2016-04-24 17:06:35,233; lycheesync.lycheesyncer; could not add P1200826.JPG to album Test

It would be great if there was a configuration option so only the thumbnails would be rotated in this case.

GustavePate commented 8 years ago

Hi !

Thanks for this bug report. Indeed I should check file permission before rotating file. I will take this in charge when I had a little time.

Yhnaks again