Skip to content
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

Wrong geopackage BLOB image rotation #43789

Closed
stuskier opened this issue Jun 18, 2021 · 18 comments
Closed

Wrong geopackage BLOB image rotation #43789

stuskier opened this issue Jun 18, 2021 · 18 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers stale Uh oh! Seems this work is abandoned, and the PR is about to close.

Comments

@stuskier
Copy link

stuskier commented Jun 18, 2021

At 3.18.3, QGIS does not take EXIF orientation metadata into account when viewing images in a Geopackage table form view, as shown in the example below.

Untitledx

In comparison, Windows File Explorer, Paint, and IrfanView all correctly display the same image non-rotated, by default:

Untitledz

There is a very clumsy, time-consuming work-around, using external software such as IrfanView, to reset the EXIF Orientation, as discussed in this StackExchange post: https://gis.stackexchange.com/questions/401836/qgis-randomly-rotates-images-stored-as-geopackage-blob

However, QGIS would really rock if it acted - by default - just like Windows File Explorer, etc., and took the EXIF orientation metadata into account when viewing images.

@roya0045
Copy link
Contributor

Unsure if this QGIS specific or provider specific.

@nicogodet
Copy link
Member

Is this related to #38611 ?
In QGis in general, EXIF orientation is not supported ?

@stuskier
Copy link
Author

stuskier commented Jun 20, 2021 via email

@SrNetoChan
Copy link
Member

If it never worked before, despite of what users would expect, it's a feature request, not a bug. See Andreas comment on the linked issue. If this is a big limitation for you, consider sponsoring the implementation or organize a crowdfunding to do it.

@nicogodet
Copy link
Member

nicogodet commented Jun 20, 2021

Tested with importPhoto processing tool (output to shapefile and gpkg), EXIF orientation is supported in table view.

How did you create your view form ?

@gioman gioman added Feedback Waiting on the submitter for answers Bug Either a bug report, or a bug fix. Let's hope for the latter! labels Jun 20, 2021
@gioman gioman changed the title Geopackage BLOB image rotation Wrong geopackage BLOB image rotation Jun 20, 2021
@stuskier
Copy link
Author

stuskier commented Jun 21, 2021 via email

@nicogodet
Copy link
Member

I used import photo tool juste to create the correct view form.

But how did you create your form ?
It looks like an html view.

When I display the image with "Attachment", orientation is OK.
image

@Houska1
Copy link
Contributor

Houska1 commented Jun 21, 2021

Could this be a Qt/QML autoTransform issue? I ran up against it a year or so back, and did my own workaround. It seemed Qt did not treat EXIF orientation consistently, there were some changes made around Qt version 5.5 or so, and when writing QML (in a form) one could get around it by including autoTransform: true. If so, it might be a reasonably easy fix.

BTW while borderline, I think this is a bug not a new feature request. If we display JPG images, georeferenced or not, we should display them correctly, which includes incorporating EXIF orientation tags which are quite commonplace.

@gioman
Copy link
Contributor

gioman commented Jun 22, 2021

When I display the image with "Attachment", orientation is OK.

@nicogodet the title seems to suggest that the photo preview comes from a binary/blob field, while normally previews are from a file system path, maybe this is an important difference?

@nicogodet
Copy link
Member

@gioman After digging, yeah it seems to be an important difference.

You have to retrieve the binary data, convert to base64, then html img...
And based on @Houska1 script on GIS stack (here), not sure this is a QGIS issue.

A feature request would be to add ability to display the blob directly (like attachment does).

@gioman
Copy link
Contributor

gioman commented Jun 22, 2021

A feature request would be to add ability to display the blob directly

@nicogodet (I haven't tried) but this is not what @stuskier is describing?

@nicogodet
Copy link
Member

@gioman Need te be confirmed but yes.

Currently it seems that the only way to display a picture stored as BLOB is to use a QML or HTML widget.
The feature would be to use attachement (which support EXIF orientation) to display the picture.
It's not exactly describe like this in first comment.

@gioman
Copy link
Contributor

gioman commented Jun 22, 2021

The feature would be to use attachement (which support EXIF orientation)

@nicogodet ok got it.

@github-actions
Copy link

github-actions bot commented Jul 7, 2021

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jul 7, 2021
@stuskier
Copy link
Author

I'm the person that originally submitted this issue. I received a github notice that it had gone stale because there was no action in the last 14 days. I'd really like to see this solved, but don't know how to get action on it. Suggestions?

@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jul 10, 2021
@gioman
Copy link
Contributor

gioman commented Jul 10, 2021

I'm the person that originally submitted this issue. I received a github notice that it had gone stale because there was no action in the last 14 days. I'd really like to see this solved, but don't know how to get action on it. Suggestions?

@stuskier see #43789 (comment) attaching a sample project+sample dataset would also help.

@github-actions
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jul 25, 2021
@github-actions
Copy link

While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue.
Or, if you have any further questions, there are also further support channels that can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

No branches or pull requests

6 participants