Feature request: specify width dimensions for inline images
-
Yogananda
Hi Benny — any word on this?
Thanks!
-
benny
Again, sorry about the late response.
What you really need is probably a way to easily make MailMate resize the image before attaching it (such that it also takes up less space). Otherwise sizing the image might be better left to the receiving email client.
There are a few things which could be done with CSS styling. The default themes don't currently specify anything for images, but you can force MailMate to add something like this:
defaults write com.freron.MailMate MmDefaultCSS -string 'img { max-width: 100%; }'That would make images resize if they are too big to be displayed (if the receiving email client respects the styling). The same could be used to force a specific maximum width. But it won't make the emails smaller.
(I'll use the above myself to see if it has undesired side-effects. Maybe it should be the default or some kind of option.)
-
Yogananda
Great, Benny — thanks!
I actually really do just want the image to have a max width of the size of the screen. I work in a team that mostly uses Gmail. We send relatively high-resolution pictures around from time to time, and it's nice for inline images to be scaled down in the message display but for the attachment to not be scaled down in resolution.
I notice that although Gmail respects the CCS styling, MailMate doesn't seem to. Even after adding the MmDefaultCSS default above, images still render in full size in MailMate. I'm working around this by adding
img { max-width: 100%; }to~/Library/Application\ Support/MailMate/Resources/MmMessagesWebView/stylesheet.css, but why would MailMate not respect this?Thanks again!
-
Yogananda
Hi Benny,
I noticed this in
/Applications/MailMate.app/Contents/Resources/MmMessagesWebView/html_stylesheet.css:img { /* max-width:100%; This does not work since it'll reduce images in non-explicitly sized containers to be zero-sized. */ }Removing the img section from this file makes MailMate respect the MmDefaultCCS default. The comment makes me worry a bit, but I'm not versed enough in HTML wonkery to understand its implications. Do you have any thoughts here?
Thanks!
-
benny
I cannot remember the exact problem cases, but it only affects what you see in MailMate. That is, it's applied to all incoming HTML messages when they are displayed. The
MmDefaultCSSsetting affects what you send, but this only happens when HTML is needed for the message. But that would be the case when inlining an image -- it's strange if that doesn't work in MailMate itself. Do you see themax-widthstyling if you view the raw message using ⌥⌘U ? -
Yogananda
Hi Benny — Yes, I do see the max-width styling in the raw message. You might have missed my previous message, but it looks like this behavior was caused by an empty img section in the default stylesheet
/Applications/MailMate.app/Contents/Resources/MmMessagesWebView/html_stylesheet.cssthat ships with MailMate. Deleting that img section fixed the problem.Thanks!
-
benny
It sounds very strange that an empty
imgCSS section should affect anything. Are you sure? Maybe something else triggered it? Or you were looking at a different message? -
Yogananda
Hmm you're right — I'm having trouble reproducing it now. Very strange.
In any event, this is a great improvement — I would definitely recommend this way of specifying max-width as a default or an option somewhere.
Thanks again!
-
Klay
Life Saver! Thank you.
defaults write com.freron.MailMate MmDefaultCSS -string 'img { max-width: 100%; }'
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.