Inline image attachments displayed upside-down (sometimes)
-
benny
I've fought this issue in the past, but I thought it worked now due to OS updates. Which version of OS X are you using now?
-
David Shepherdson
I'm on 10.11.6, unfortunately... So unless it's fixed in 10.12? :-)
-
benny
- State changed from new to cantreproduce
:( MailMate just uses a webview (like the one used in Safari) and relies on that to make the correct orientation. You can send me an example email via “Help ▸ Send Feedback” if you like, but I'm afraid it's not easily fixed (I don't really know).
-
David Shepherdson
Yeah, I had assumed it must be something like that. Having done a little bit more experimentation, if I open one of these images directly in Safari (or Firefox, just for a point of comparison), it's displayed in the 'correct' orientation; however, if I make a simple HTML page with an image tag pointing to the same image file, and load this page in the browser (either one), then the image appears with the 'wrong' orientation.
So this is clearly not just MailMate's fault! I'll see if I might be able to raise a bug on the WebKit side (and Mozilla, for that matter), since I have a nice simple reproducible test case. Maybe if they fix it there, at some point in the future, the fix will make its way to MailMate too!
-
David Shepherdson
And having done a bit more investigation in readiness for raising a bug with WebKit, it seems this is an existing, known issue, and has been for years... :-(
There's a long discussion on the topic as part of WebKit bug 19688, which seems to end up with an indication that something was implemented back in 2012, but not turned on by default? It seems like there's meant to be a setting for
WebKitShouldRespectImageOrientation, but when I try this viadefaults writefor either MailMate or Safari, it has no effect on the inline images.There's also apparently a CSS property to make this work, via
image-orientation: from-image; this was implemented in Firefox in 2013, and sure enough adding that style to my HTML test page makes it work in Firefox, but no other rendering engines support it at present, as far as I can tell.(And just to confuse things further, iOS WebKit renders images this way by default, in contrast with the Desktop version, according to the CanIUse listing.)
So, unless they implement the
image-orientationsupport in WebKit as per WebKit bug 89052, it doesn't look like there's anything MailMate can do about this sort of problem.(I just thought it worth noting all this down here for future reference, and for anybody else who might come across the same problem.)
-
benny
Thanks for the investigation. Could you try creating the following path and file:
/Users/<username>/Library/Application\ Support/MailMate/Resources/MmMessagesWebView/html_stylesheet.cssIt should have this content:
img { image-orientation: from-image; border-radius: 50%; }Then relaunch MailMate to make sure it doesn't make a difference. The
border-radiusline is just to make sure that you can see that the stylesheet is loaded and applied (the image is cropped in a circular shape).Also, I looked in my defaults and I have the following value (which I cannot recall adding myself):
MmMessagesWebViewWebKitShouldRespectImageOrientation = 0;This indicates that you should also try this:
defaults write com.freron.MailMate MmMessagesWebViewWebKitShouldRespectImageOrientation -bool YESThen relaunch and see if it makes a difference.
-
David Shepherdson
Thanks for the suggestions -- I've just tried both of those (independently and together), and (as expected?) neither made a difference (though the
border-radiuswas definitely being applied).Some comments I've seen elsewhere (Chromium bug 25508 and W3C discussion of the spec) imply that it might work with the current WebKit implementation if the image is in an
iframerather thanimgtag; I've just tried this in my test page in Safari, and the image is indeed displayed with the correct orientation.But that wouldn't really be a practical solution for MailMate, especially with HTML messages that already contain
imgtags in the first place!So back to waiting for it to be implemented/fixed in WebKit, I'd say. At least it's not a big deal, given QuickLook uses the correct orientation anyway.
-
benny
- State changed from cantreproduce to closed
Ok, thanks for trying it out. I'll leave the image-orientation in the default HTML stylesheet in case support is added in the future.
-
David Shepherdson
Sounds great; thanks Benny!
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.