Announcement

#1 2018-07-17 09:01:17

hglkrijger
Member
2018-07-17
1

images.addSimple appears to work but thumbnails broken

Hello,

I am writing a OneDrive sync client, and placing the sync'ed files in the upload folder. I would then like to add them to Piwigo through the api.

I am interacting with the api through the Python piwigo package. When I call the addSimple api, everything seems to work as expected:

import piwigo
from piwigo import Piwigo
mysite = Piwigo("https://mysite.com")
mysite.pwg.session.login(username='...', password='...')
mysite.pwg.images.addSimple(image="/datadisk/upload/2017/07/02/20170701_190431634_iOS.jpg")

{u'url': u'https://mysite.com/picture.php?/15644', u'image_id': 15644}

I can see the orphaned photo listed in Piwigo, but the thumbnail is broken. If I 'zoom', I get a 'failed to load image'. However, if I download the original photo, that works fine.

Perhaps of interest is this:

>>> mysite.pwg.images.getInfo(image_id=15644)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/piwigo/ws.py", line 96, in checking
    return fn(self, **kw)
  File "/usr/local/lib/python2.7/dist-packages/piwigo/ws.py", line 132, in __call__
    raise e
piwigo.ws.WsPiwigoException: 401 : Access denied

The session is created with my webmaster account, and Python is running under sudo. The file on disk has the following permissions:

$ ls -lh /datadisk/upload/2017/07/02/20170701_190431634_iOS.jpg
-rwxrwxrwx 1 www-data www-data 1.8M Jul 15 09:46 /datadisk/upload/2017/07/02/20170701_190431634_iOS.jpg

I would appreciate any tips on how to troubleshoot, or suggestions as to what I might be missing.

Piwigo 2.9.4
Operating system: Linux
PHP: 7.2.7-1+ubuntu18.04.1+deb.sury.org+1 (Show info) [2018-07-16 23:57:05]
MySQL: 5.5.5-10.1.29-MariaDB-6 [2018-07-17 06:57:05]

Thanks!
Hans

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact