Closed Bug 877520 Opened 11 years ago Closed 11 years ago

Thunderbird should make use of exif orientation when displaying attached images

Categories

(Thunderbird :: Theme, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 26.0

People

(Reporter: list, Assigned: Paenglab)

References

Details

(Whiteboard: [tb31features])

Attachments

(2 files)

Attached image DSC_0111.jpg
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release)
Build ID: 20130512194445

Steps to reproduce:

I received an email with the attached image (DSC_0111.jpg) as an attachment. 


Actual results:

Thunderbird showed the image in landscape orientation


Expected results:

Thunderbird should have displayed the image in portrait orientation as defined in the Exif information.

This is a consistent issue and to view pictures properly I have to open them with an external viewer that interprets the Exif information correctly.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Looking at the proposed patch in attachment 784597 [details] [diff] [review] for bug 298619, it appears that this would only fix the issue for stand-alone images. However, that's a style sheet which seems to be used by the browser only but not by mailnews for the display of attachments. Thus, a similar fix might be necessary for the mailnews style sheet once bug 825771 is fixed, but should be straightforward.

Meaning, this may not be a duplicate after all; we'll see once the patches for those other bugs have checked in.
If my assumption is correct, a rule needs to be added to messageBody.css setting {image-orientation: from-image;} for the moz-attached-image class in all themes, or <img> in general to also catch inlined (not just attached) images.

Tentatively reopening for that purpose.
Status: RESOLVED → REOPENED
Component: Untriaged → Theme
Ever confirmed: true
OS: Linux → All
Hardware: x86_64 → All
Resolution: DUPLICATE → ---
Version: 17 → Trunk
Yes this needs probably a

.moz-attached-image {
  image-orientation: from-image;
}

in messageBody.css. But we have to wait until bug 825771 is fixed.
Status: REOPENED → NEW
Depends on: 825771
Any reason to not restrict this to just attached images but to images referred to from an HTML part as well? Meaning, if the sender of an e-mail includes an image in this way but doesn't specify "image-orientation: from-image;" should it be implied or rather not?
In HTML it should be shown as the creator created the page/mail and the orientation should be taken from page/mail's CSS to not break the layout. Until now no HTML creator tool that I know supports the EXIF orientation.

On standalone images like from attachments it is okay to use this as it can't break a layout.
Ok, makes sense.
So, who wants to make the patch? bug 825771 is now fixed
Summary: Thunderbird ignores exif orientation when displaying images → Thunderbird should make use of exif orientation when displaying attached images
When we will do it through CSS, I can do it.
Assigning to you then. It should work now on tip, since bug 825771 just landed.
Assignee: nobody → richard.marti
(In reply to Richard Marti [:Paenglab] from comment #9)
> When we will do it through CSS, I can do it.

"image-orientation: from-image" works great for me in my testcases.
I just applied it as an inline style on some flipped images.
Anything that I can do to help move this along, just ask
OTOH If this lands, it should take care of it for us
https://bugzilla.mozilla.org/attachment.cgi?id=784597
That's only for when the browser displays just an image. For us it's more inline even if it's an attachment.
Attached patch patchSplinter Review
This patch applies the image-orientation: from-image for attached images only. Images in HTML messages aren't affected by this patch and are still showed as they should.

ui-r? to ask if we really want this (I'm for it but a second opinion is always good ;) ).
Attachment #797739 - Flags: ui-review?(bwinton)
Attachment #797739 - Flags: review?(bwinton)
Comment on attachment 797739 [details] [diff] [review]
patch

Review of attachment 797739 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, this seems like kind of a no-brainer to take.  ;)
ui-rs=me, rs=me.

Thanks,
Blake.
Attachment #797739 - Flags: ui-review?(bwinton)
Attachment #797739 - Flags: ui-review+
Attachment #797739 - Flags: review?(bwinton)
Attachment #797739 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/a07f54d20dc6
Status: NEW → RESOLVED
Closed: 11 years ago11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 26.0
Blocks: 915909
(In reply to Richard Marti [:Paenglab] from comment #6)
> In HTML it should be shown as the creator created the page/mail and the
> orientation should be taken from page/mail's CSS to not break the layout.
> Until now no HTML creator tool that I know supports the EXIF orientation.

So, when we compose a message in HTML, should the <IMG> tag be supplied with a style="image-orientation: from-image;" attribute, given that there usually are no CSS style sheets associated with messages? I'll be happy to open a new MailNews bug for that, but maybe it's not the right thing to do at that level, or the Editor code should provide that option. Opinions?
(In reply to rsx11m from comment #17)
> So, when we compose a message in HTML, should the <IMG> tag be supplied with
> a style="image-orientation: from-image;" attribute, given that there usually
> are no CSS style sheets associated with messages? I'll be happy to open a
> new MailNews bug for that, but maybe it's not the right thing to do at that
> level, or the Editor code should provide that option. Opinions?

I also don't know what's the right thing, but I think opening a MailNews bug looks okay.
(In reply to rsx11m from comment #17)
 
> So, when we compose a message in HTML, should the <IMG> tag be supplied with
> a style="image-orientation: from-image;" attribute, given that there usually
> are no CSS style sheets associated with messages? I'll be happy to open a
> new MailNews bug for that, but maybe it's not the right thing to do at that
> level, or the Editor code should provide that option. Opinions?

I think you would still see a high level of resistance to having the Editor automatically applying an inline styles. The argument would be compatibility with other software, I think. But they are catching up with CSS support. Gmail for example handles inline styles, but not stylesheets AFAICT.

My particular use case is with images received from Iphones. And these are as attachments and not inline. I really don't think it's possible to insert an inline image with an Iphone. Tablets might be another story.

It would make a nice extension though, to be able to control image orientation while viewing.
I've filed bug 916104 to continue this discussion on the composition side.
Whiteboard: [tb31features]
You need to log in before you can comment on or make changes to this bug.