thunderbird-android icon indicating copy to clipboard operation
thunderbird-android copied to clipboard

Feature request - Resize image in k9mail on the fly

Open francwalter opened this issue 9 years ago • 30 comments

Hello

this is only a feature request, not an issue.

There could be an option to resize an added image on the fly to a lower resolution. In the options or in a dialog when I add a picture (JPG etc.). There is no way in k9mail to do this. Some email-clients can do this, not sure if it is easy done in k9mail, but it would be extremely useful. At the moment I use an external app to resize pictures and send them to k9mail then.

By the way, what I dream of is a kind of option to use k9mail as Chat Client, e.g. like WhatsApp, Signal, Threema, etc. Could be done I guess and would be very handy on a Smartphone :)

Environment

K-9 Mail version: 5.010

Android version: CM 13 nightly of 21.10.2016 on Samsung Galaxy S4

Account type (IMAP, POP3, WebDAV/Exchange): IMAP

Thanks.

frank

francwalter avatar Oct 26 '16 12:10 francwalter

You're talking about resizing images when you attach them to a new email, just to be clear?

As for chat clients, nice thought, but e-mail is complex enough ;)

philipwhiuk avatar Oct 26 '16 12:10 philipwhiuk

Yes, this I mean. I have most pictures with some 5 MB big ("13 MPX") and as email it is not really useable in this size. Mostly I need only pictures in a low resolution, as in Chat Clients. They resize it automatically.

francwalter avatar Oct 26 '16 13:10 francwalter

As for chat clients, nice thought, but e-mail is complex enough ;)

Just a few changes, like the above auto resize or show the mail history as a chat history compactly, and some other things. I am sure this could be done and this would higher the usefulness of k9mail a lot. On smartphones often a simple chat client is the first choice for fast communication for me, but what can a chat client do that couldn't be done in an email client? It's p

francwalter avatar Oct 26 '16 14:10 francwalter

Sorry, I hit the wrong button :)

francwalter avatar Oct 26 '16 14:10 francwalter

Ok. We probably can do slightly better on email threading - there's other issues open for that though.

Let's keep this one focused on the image resizing.

philipwhiuk avatar Oct 26 '16 15:10 philipwhiuk

Could it be done? Is it a reasonable feature request?

francwalter avatar Oct 26 '16 15:10 francwalter

its not a good idea to make an app do everything.

you should rather use: https://f-droid.org/repository/browse/?fdfilter=size&fdid=mobi.omegacentauri.SendReduced or https://play.google.com/store/apps/details?id=mobi.omegacentauri.SendReduced

zoff99 avatar Oct 26 '16 15:10 zoff99

I'm in two minds.

On the one hand, image manipulation is not really the job of an email program.

On the other hand, I disagree with the idea that you should need a separate app. This is not something like OpenPGP where your PGP key could have uses outside of email. It's specifically about sending email.

SendReduced is open source, it's Apache2 licensed and it's on GitHub - There's no reason why we couldn't reuse 90% of the code:

https://github.com/arpruss/sendreduced/

If the maintainers co-operated we could modify the upstream library into a core code module and app module and the core code module could be used directly in K-9. We do something similar to allow K-9's functionality to be re-used.

Even if they didn't we could still maintain a close fork and downstream fixes when necessary.

I think it's a reasonable feature on balance - but it needs developer time to implement. The Attachment code would need to hook into the reducing code appropriately.

philipwhiuk avatar Oct 26 '16 15:10 philipwhiuk

it can be used for other things, like sharing your images via a messenger or bluetooth. it also can strip EXIF data. 1 app should do 1 thing good, not many things average.

zoff99 avatar Oct 26 '16 17:10 zoff99

Does anyone on a smartphone attach 5 or more mb pictures?? This would be a rare scenario. When there is no easier way to send a foto than email I nearly always reduce size with another app which makes it more uncomfortable to use k9mail. And k9mail is a client mostly for smartphones.

And the idea to use one app for doing one thing good can be exactly used here: I will need size reduced images on an app which is optimized for smartphones. This should be then part of the app

francwalter avatar Oct 26 '16 18:10 francwalter

the best (ideal) option would be to work together with the dev of SendReduced and define an API, so both apps can work together seamless. doesn't make any sense that k-9 devs need to manage even more features and keep them up-todate

zoff99 avatar Oct 27 '16 07:10 zoff99

@cketti : I want to work upon the above issue, but am not able to understand, why integrating the feature into k-9 would be a bad idea. It can be done using a 3rd party library, or developed from scratch.

harjot-oberai avatar Mar 02 '17 14:03 harjot-oberai

I don't mind including this functionality in K-9 Mail. However, I'd like to see a UI/UX concept first.

Things to consider:

  • Resizing takes time. When should it be done? How is the progress visualized?
  • Some people only want to occasionally resize images. Some people only occasionally want to not resize images. How can we accommodate both groups without asking every time an image attachment is added?
  • What size should images be resized to by default?
  • Should there be a setting with multiple options?

cketti avatar Mar 02 '17 19:03 cketti

I would expect image resizing to be in the sub-second range. Either way, this should integrate neatly with Attachment.LoadingState. I also think asking every time an image attachment is added is fine, similar to this maybe:

Valodim avatar Mar 02 '17 19:03 Valodim

I guess it could be done after the user presses send. That way the user can change the default behavior (via a button on the attachment box or something) before the image is resized.

cketti avatar Mar 02 '17 19:03 cketti

  • The approach that I was thinking of includes a resize button/option in the attachmentView. It solves 2 problems :

    1. In case multiple images are selected, the user would not get multiple dialogs one after the another.
    2. It will work for both groups of people, those who resize occasionally and those who don't. It will be as easy to use as deleting the attachment.
  • Resizing would most probably take less than a second, so I don't think we should worry about showing a progress for it.

  • Also I think multiple default resize options should be given (as shown in above pic). We may add an option for custom size if needed.

  • I think resizing should be done as soon as user chooses a resize option, instead of resizing after clicking send.

  • I wish to reuse the existing methods, so my approach will be as follows :

    1. When a user chooses a resize option a temporary file is created that holds the the resized image.
    2. The current attachment is removed and a new attachment is added with Uri from the temporary file.

harjot-oberai avatar Mar 02 '17 20:03 harjot-oberai

Resizing after "user chooses a resize option" implies user interaction. That's not acceptable for users who want to resize images most of the time. User interaction should be the exception, i.e. only necessary if you don't want the configured default behavior.

cketti avatar Mar 02 '17 20:03 cketti

We can add an option in the global settings for that. User can choose a default resize option (1/2 or 1/4th size) and it will be applied automatically to all image attachments.

harjot-oberai avatar Mar 02 '17 20:03 harjot-oberai

Well, yes. That's what my comment implied.

Settings: default behavior Button on attachment box: override default

Then do the actual resizing after the send button has been pressed. Because only then you know that the user won't change their mind and override/change the resize option of an attachment.

cketti avatar Mar 02 '17 20:03 cketti

Ok, I misinterpreted your comment. I will start working on it now, and comment here in case of any issue 👍

harjot-oberai avatar Mar 02 '17 20:03 harjot-oberai

By the way, what I dream of is a kind of option to use k9mail as Chat Client, e.g. like WhatsApp, Signal, Threema, etc. Could be done I guess and would be very handy on a Smartphone :)

Now, years later, there is something like it, called Delta Chat also on github. That was exactly what I ment!

By the way, is there any progress on image resize on the fly in k9mail? I since this issue use Send Reduced Pro, which is OK, but other email clients have that image reducing on the fly.

2020-06-04, years later: since a good while there is even a PR for a image resize version but it has been never merged. So since some months I use FairEmail, also opensource with even more functions (one of them image resize) and settings. Works better for me :) k9mail I use only on a device with few internal memory, because FairEmail needs much more space. By the way: Image Reduced doesn't work anymore on Android 9 and is since long abandoned.

francwalter avatar Nov 26 '17 16:11 francwalter

There seems to be a solution that is not merged yet: https://github.com/k9mail/k-9/pull/2335

Flexmaen avatar Jan 17 '18 13:01 Flexmaen

As SendReduced is not available in F-Droid anymore, here's an alternative as long as the feature is not included in K-9: Imagepipe

mbeko avatar Dec 12 '21 21:12 mbeko

Any news about this feature? Indeed it's much missed, as bigger and bigger picture don't make sense as attachment. So far, my workaround is to send pictures to myself via chat (Signal), so they get resized... hardly efficient.

tmanaud avatar Jul 16 '22 10:07 tmanaud

Give FairEmail a try! I use it since years now, paid version, never looked back to k9mail :)

francwalter avatar Jul 17 '22 06:07 francwalter

SendReduced is nice and all, but many users don't go looking for images (especially if you intend to attach more than just images to an email) before composing an email, they start with the email and then attach a bunch of things.

Just to give an idea of how needed this is in the real world: users with limited connectivity or limited/expensive mobile data (in Canada it's ludicrously expensive) or in developing countries routinely dismiss K9 mail and pick another proprietary app (like AquaMail) just because they can't size down the images they attach to their emails, while other apps do. In some countries, like Cuba, until any attachment bigger than 30 kilobytes meant a fortune to them.

For encoding, I would recommend K9 to use MozJPEG, as it's hands down the best "traditional JPEG" encoder out there, it makes traditional JPEG pretty much competitive with WebP in terms of filesizes (and hey, MozJPEG is a Mozilla technology, so that makes a lot of sense for K9 mail becoming Thunderbird on mobile)... the only better format for photos would be JPEG XL, but it's not really possible until the other mail clients, browsers and mobile OSes support it; whereas MozJPEG-encoded traditional JPEG would work everywhere without new decoders.

nekohayo avatar May 02 '23 12:05 nekohayo

Was expecting this feature to be built in. Last time I used k-9 was in Android 2.x and had to drop it over lack of exchange support. Is it feasible to expect the integration of this feature (and also directly snap, optimize and attach pictures from the attach file menu) in a relatively small time window (considering this feature was requested 6 years ago)?

frmariam avatar Nov 23 '23 10:11 frmariam

Meanwhile, there are another few apps like Imagepipe available on F-Droid.. https://codeberg.org/Starfish/Imagepipe.

Perhaps the best course of action would be for K9 Mail to suggest those Apps while attaching images and make the process as easy as possible.. although it is pretty easy already now.

Those Apps have some benefit over a pure resolution reduction/compression, offering cropping, exit tag filtering and more goodies you don't want to reimplement in an email program

xandro0777 avatar Apr 04 '24 10:04 xandro0777

Meanwhile, there are another few apps like Imagepipe available on F-Droid.. https://codeberg.org/Starfish/Imagepipe.

Perhaps the best course of action would be for K9 Mail to suggest those Apps while attaching images and make the process as easy as possible.. although it is pretty easy already now.

Those Apps have some benefit over a pure resolution reduction/compression, offering cropping, exit tag filtering and more goodies you don't want to reimplement in an email program

I dont agree: most mobile users simply dont know how to handle files, they just browse image from gallery click "attach".

Any chat app (Signal, Telegram, etc...) will not even ask you and resize image directly (croping/editing is something else) because sending image full size (10MB+) is usually not what you want to do.

K9mail includes external PGP support, while mainstream users never heard of this (beside linux guru), what about having a simple feature like this implemented and gain general user adoption?

tmanaud avatar Apr 04 '24 10:04 tmanaud

On April 4, 2024 10:50:53 AM UTC, Tweepy @.***> wrote:

Any chat app (Signal, Telegram, etc...) will not even ask you and resize image directly (croping/editing is something else) because sending image full size (10MB+) is usually not what you want to do.

Yes and that is exactly what I hate about those Apps. I have a few of them, why should I bother with so many image reducing Guis if a single app can do it. Even figuring out how to send an image in original quality is a hassle in those Apps because each has another way to do it.

Also Email isn't yet another chat App. People expect sending attachments without unsolicited manipulation by App or server, completely different use case and different users.

Email is not a replacement for chat apps and exists for different reasons.

Did you try it.. sharing or picking images through Imagepipe or similar is in no way difficult.

K9mail includes external PGP support, while mainstream users never heard of this (beside linux guru)

LOL, OT. Mainstream users probably never heard about PGP in first place. And yes.. the PGP integration in Thunderbird was a disaster. Refused to import my keys and never worked for me since than. Perhaps 10,000 open bugs on the subject last I looked. One of the two or three working open source email clients with good PGP support totally ruined.

xandro0777 avatar Apr 04 '24 12:04 xandro0777