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

Feature request - Resize image in k9mail on the fly #1758

Open
francwalter opened this issue Oct 26, 2016 · 30 comments
Open

Feature request - Resize image in k9mail on the fly #1758

francwalter opened this issue Oct 26, 2016 · 30 comments
Labels
status: help wanted Issues seeking help from the community type: enhancement New features or improvements to existing features.

Comments

@francwalter
Copy link

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

@philipwhiuk
Copy link
Contributor

philipwhiuk commented Oct 26, 2016

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 philipwhiuk added the type: enhancement New features or improvements to existing features. label Oct 26, 2016
@francwalter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Sorry, I hit the wrong button :)

@philipwhiuk
Copy link
Contributor

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.

@francwalter
Copy link
Author

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

@zoff99
Copy link

zoff99 commented Oct 26, 2016

@philipwhiuk
Copy link
Contributor

philipwhiuk commented Oct 26, 2016

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 philipwhiuk added the status: help wanted Issues seeking help from the community label Oct 26, 2016
@zoff99
Copy link

zoff99 commented Oct 26, 2016

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.

@francwalter
Copy link
Author

francwalter commented Oct 26, 2016

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

@zoff99
Copy link

zoff99 commented Oct 27, 2016

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

@harjot-oberai
Copy link
Contributor

@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.

@cketti
Copy link
Member

cketti commented Mar 2, 2017

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?

@Valodim
Copy link
Contributor

Valodim commented Mar 2, 2017

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:

@cketti
Copy link
Member

cketti commented Mar 2, 2017

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.

@harjot-oberai
Copy link
Contributor

harjot-oberai commented Mar 2, 2017

  • 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.

@cketti
Copy link
Member

cketti commented Mar 2, 2017

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.

@harjot-oberai
Copy link
Contributor

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.

@cketti
Copy link
Member

cketti commented Mar 2, 2017

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.

@harjot-oberai
Copy link
Contributor

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

@francwalter
Copy link
Author

francwalter commented Nov 26, 2017

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.

@Flexmaen
Copy link

There seems to be a solution that is not merged yet:
#2335

@mbeko
Copy link

mbeko commented Dec 12, 2021

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

@tmanaud
Copy link

tmanaud commented Jul 16, 2022

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.

@francwalter
Copy link
Author

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

@nekohayo
Copy link

nekohayo commented May 2, 2023

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.

@frmariam
Copy link

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)?

@xandro0777
Copy link

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

@tmanaud
Copy link

tmanaud commented Apr 4, 2024

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?

@xandro0777
Copy link

xandro0777 commented Apr 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted Issues seeking help from the community type: enhancement New features or improvements to existing features.
Projects
None yet
Development

No branches or pull requests