ipadorientationphotoopentbs

Some images shown rotated with OpenTBS


With OpenTBS I'm showing a series of images in a Word document. I use following code in my template file:

[imgs; block=begin]
// image placeholder // 
Figuur 1: [imgs.txt]
[imgs.fname;ope=changepic;adjust=inside]
[imgs; block=end]

Using OpenTBS 1.10.7 with tbs_class 3.14.0.

This is working nicely for landscape photo's. It also is working good for some portrait photos, but other portrait photos are shown rotated. This seems to be related to the device taking the photo. No problem with my OnePlus phone, but problems with at least Ipad and some Samsung devices. All photos show correct when viewing the image on the local storage.

Not sure if there are device specific settings that could solve this, or can I improve something in my PHP code or Word template?


Solution

  • Turns out OpenTBS is ignoring the exif-rotation information in a photo.

    Adding to my PHP script a function similar to the solution mentioned in PHP read_exif_data and Adjust Orientation solved my issue.

    Hope this helps others with similar problem.