[Qgis-user] Image orientation

Thayer Young thayeray at yahoo.com
Wed Mar 24 12:25:05 PDT 2021


 Hi Tony,
The map tips functionality for viewing photos is very difficult to style.
The ImportPhotos plugin has a nice interface for viewing your photos, you can also navigate between photos without having to move the cursor or click again. Navigation is chronological if you use the "Import Geotagged Photos" tool to "import" the photos. On my system the plugin imports them in a random order. 
Unfortunately the ImportPhotos plugin does not correct for the rotation, it seems to look only at the width and height. You may be able to correct this with image processing software before QGIS.
-Thayer

===========================================================================================Date: Tue, 23 Mar 2021 11:36:35 +0000
From: Tony Spiess <spiesspurchaser at outlook.com>
To: "qgis-user at lists.osgeo.org" <qgis-user at lists.osgeo.org>
Subject: [Qgis-user] Image orientation
Message-ID:
    <LNXP123MB20765A52B32E727AB8876110AA649 at LNXP123MB2076.GBRP123.PROD.OUTLOOK.COM>
    
Content-Type: text/plain; charset="us-ascii"

Hi,
A very newbie, Zurich/Win10.
Imported my photos into QGIS, used Display <img src="file:///[% photo %]" width="350" height="250"/>, toggled Map Notes, added single label, all worked fine.
Except my photos are landscape but some are portrait.
QGIS strips out most of the photo metadata but leaves Fields "photo" (combined path and filename) and "rotation" which is either 90 or 0 amongst others. NB: QGIS put Fields Long then Lat but other GPS software expect Lat then Lon.
So as QGIS Expression has an IF THEN function is should be possible to check which "rotation" and change width and height accordingly.
But I know QGIS syntax is very picky, so cannot stumble in the dark trying to guess how the expression should go.
I guess something along the lines of:
<img src=if("rotate"=0, "file:///[% photo %]" width="350" height="250","file:///[% photo %]" width="250" height="350")/>
Can anyone please tell me what I need to change please.
Tony


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210324/7cfbd645/attachment.html>


More information about the Qgis-user mailing list