-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect image orientation in layout(picture), HTML widget, map tips #34868
Comments
Yes - fixing the picture item should be relatively straightforward, using the same approach as 574a654. As you've rightly guessed, the HTML based widgets are a lot trickier. Looks like adding custom js to your html to handle this is the only viable approach... |
+1 |
Hi, I have made a fix for this issue (my first pull request, so hopefully I have done the right job!). Its adding a extra attribute to the photo table with exif orientation. The could then be rotated in maptips by using som case when eg:
|
Beware if this code is in a table because the |
QGIS display of photos (via an attribute referencing a file or URL) does not reflect the image's EXIF orientation tag in several places:
EXIF orientation is of course a bugbear in HTML, with at best dubious normal browser support, and images intended for web use are best saved pre-rotated. However, given the increasing integration of QGIS with fieldwork, where photos with cameras that use the orientation tag are pretty typical, out-of-the-box support would be helpful.
I'm guessing the places orientation is reflected are where QGIS uses
QImageReader
withsetAutoTransform=true
as opposed to an HTML engine rendering an<img>
. So I'm hoping fixing #3 above might be easy, while #1 and #2 are likely harder?(There are, of course, workarounds, but they're a hassle -- for now I'm extracting the Orientation tag as a separate attribute in the layer and then using data-driven rotations and resizing to fit inside the specified rectangle in a layout.)
A prior commit that seems to have fixed this for the attachment widget is 574a654
The text was updated successfully, but these errors were encountered: