flingo64 / PhotoStation-Upload-Lr-Plugin

Photo StatLr (aka PhotoStation Upload) is a Lightroom Publish and Export Service Plugin that enables the export /publishing of photos and videos from Lr to a Synology Photo Station. It uploads the photos/videos and all required thumbnails. It can download comments and ratings and do a real two-way synch of various metadata (tags, ratings, labels).
http://messmer-online.de/index.php/software/11-photo-statlr
GNU General Public License v3.0
209 stars 21 forks source link

Catch missing Rotation parameter #34

Closed stepman0 closed 5 years ago

stepman0 commented 5 years ago

I had multiple issues where exporting of my pictures failed. Debugged showed that either personTag.rotation or personTag.trotation where nil.

I added a check and set them to zero in case of nil.

flingo64 commented 5 years ago

I can see that region.Rotation may be nil and maybe also region.Name, although none of my photos did ever raise this exception. On the other hand, I cannot see how photoRotation may be nil under any circumstance: it's properly initialized in line 306 ff. Anyway, the checks won't hurt and I would do it like this: personTag.rotation = ifnil(photoRotation, 0) personTag.trotation = ifnil(region.Rotation, 0) personTag.name = ifnil(region.Name, '')

Could you give me some environment info:

Thanks, Martin

stepman0 commented 5 years ago

To be honest, I am not quite sure if really both photoRotation and region.Rotation were nil, it was late in the evening when I looked into this. I just added both checks to be sure.

Your notation is much better then mine, I don't have much experience with lua.