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

Picture Resize #262

Closed
Darkxaser opened this issue Mar 4, 2022 · 8 comments
Closed

Picture Resize #262

Darkxaser opened this issue Mar 4, 2022 · 8 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Darkxaser
Copy link

in the original Rainloop there is the possibility to include images directly into the email and to change the size. Will you add this feature again? That would be great

picture

@the-djmaze
Copy link
Owner

Actually: RainLoop does not resize the picture.
It's a feature of CKEditor and the only thing that happens is that what you see is "smaller".
The image can still be 10MiB and 4000x4000 pixels.

In ?admin go to extensions and install CKEditor. It might work for you.

@Darkxaser
Copy link
Author

thank you for the quick reply. when I activate the feature, I have a white field in the email. But no other editing options are displayed. Also the drag and drop does not work with all images.

thanks for the support

cmyk
cmyk2

@Darkxaser
Copy link
Author

I have tested this again. The window for editing the resolution appears behind the e-mail. When does the email minimize to get to the editor window. This error happens only in Brave browser in Firefox this does not happen. But in all browsers you have a white border under the email. As I have already tried to show in the screenshot above.

cmyk3

@yeupou
Copy link

yeupou commented May 1, 2022

I would like to support the idea of an actual resize of the attached files as option. These days, with most cameras, photos are way bigger than what is accepted by most mail servers. At most you can attach 2 or 3 before reaching a 10MB limit. Sometimes you would like to send 10 without preserving best quality.

It would be great if automatic resize was an option.

@the-djmaze
Copy link
Owner

the-djmaze commented May 2, 2022

@yeupou indeed!
But that requires a <canvas> element.
So, when embedding an image:

  • don't use <img>, use <canvas>
  • resize canvas
  • on submit convert canvas to <img src="canvas.toDataURL()">

Resizing is like:

const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");

// step 1 - resize to 75%
const tmp_c = document.createElement('canvas');
const tmp_ctx = tmp_c.getContext('2d');
// Set the width & height to 75% of image
tmp_c.width = img.width * 0.75;
tmp_c.height = img.height * 0.75;

// step 2, resize to temporary size
tmp_ctx.drawImage(img, 0, 0, tmp_c.width, tmp_c.height);

// step 3, resize to final size
ctx.drawImage(oc, 0, 0, tmp_c.width * 0.75, tmp_c.height * 0.75, 0, 0, canvas.width, canvas.height);

@Darkxaser
Copy link
Author

Hi, would like to replace rainloop completely with snappy. Do you think you can get rid of the error I showed above?

Would be really nice

@the-djmaze the-djmaze added bug Something isn't working enhancement New feature or request labels Oct 16, 2022
@the-djmaze
Copy link
Owner

For now all images that are pasted will get resized to max 1024px

@fabiodepin
Copy link

See #1593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants