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

JMAP spec about attachment thumbnails #593

Open
Arsnael opened this issue Mar 10, 2023 · 10 comments
Open

JMAP spec about attachment thumbnails #593

Arsnael opened this issue Mar 10, 2023 · 10 comments
Labels

Comments

@Arsnael
Copy link
Member

Arsnael commented Mar 10, 2023

Write a custom tmail attachment thumbnails spec allowing users to fetch thumbnails of their mail attachments

A user should be able to see small preview of his attachments (thumbnails) when reading his emails without necessary having to fully download it

This would be implemented as a new JMAP download api route that would return the thumbnail :

GET download/{accountId}/thumbnail/{blobId}

Alongside a new capability extension defined as com:linagora:params:jmap:thumbnails

The route would return 404 if no thumbnail is found.

We need to advertise this in the jmap session as well

DoD : spec written

@Arsnael
Copy link
Member Author

Arsnael commented Mar 10, 2023

Question: I saw initially a size was proposed as query param (small|medium|large).

I took it out as the size is done when we generate and store the thumbnail with the listener. I don't think we want to store it 3 times either on the different sizes. So to me that query param is unecessary?

WDYT?

@chibenwa
Copy link
Member

Maybe we need to experiment with linThumbnail to understand exact dimensions of small, medium, large.

If we choose one of them that fits all the cases then I am OK to discard the others.

@quantranhong1999
Copy link
Member

I don't think we want to store it 3 times either on the different sizes

IMO different sizes could help the client side have choices to load/render the thumbnail depending on network connection condition/device resolution. E.g:

  • GIVEN web device/tablet THEN Client side could load LARGE size
  • GIVEN mobile device has 4G network THEN client could load SMALL size, or even do not load thumbnail.

Think about Youtube video resolution.
But yes as Benoit said we may need to see the how is the quality of thumbnail first.

@vttranlina
Copy link
Member

vttranlina commented Mar 13, 2023

Maybe we need to experiment with linThumbnail to understand exact dimensions of small, medium, large.

If we choose one of them that fits all the cases then I am OK to discard the others.

My lab:

1. JPG file
-rw-rw-r-- 1 tungtv tungtv 4289163 Thg 3  13 11:43 LARGE.png
-rw-rw-r-- 1 tungtv tungtv  469476 Thg 3  13 11:43 MEDIUM.png
-rw-rw-r-- 1 tungtv tungtv 2978233 Thg 1   7 00:14 original.jpg
-rw-rw-r-- 1 tungtv tungtv   61525 Thg 3  13 11:43 SMALL.png
➜  jpg identify SMALL.png
SMALL.png PNG 180x135 180x135+0+0 8-bit sRGB 61525B 0.000u 0:00.000
➜  jpg identify MEDIUM.png         
MEDIUM.png PNG 600x337 600x337+0+0 8-bit sRGB 469476B 0.000u 0:00.000
➜  jpg identify LARGE.png        
LARGE.png PNG 1920x1080 1920x1080+0+0 8-bit sRGB 4.09046MiB 0.000u 0:00.000


2. PDF file
-rw-rw-r-- 1 tungtv tungtv 1053880 Thg 3  13 11:45 LARGE.png
-rw-rw-r-- 1 tungtv tungtv  156356 Thg 3  13 11:45 MEDIUM.png
-rw-rw-r-- 1 tungtv tungtv  712618 Thg 1   4 10:02 original.pdf
-rw-rw-r-- 1 tungtv tungtv   21007 Thg 3  13 11:45 SMALL.png
➜  pdf identify SMALL.png 
SMALL.png PNG 180x135 180x135+0+0 8-bit sRGB 21007B 0.000u 0:00.000
➜  pdf identify MEDIUM.png 
MEDIUM.png PNG 424x600 424x600+0+0 8-bit sRGB 156356B 0.000u 0:00.000
➜  pdf identify LARGE.png   
LARGE.png PNG 1240x1753 1240x1753+0+0 8-bit sRGB 1053880B 0.000u 0:00.000

3. ODT File
-rw-rw-r-- 1 tungtv tungtv  441862 Thg 3  13 11:46 LARGE.png
-rw-rw-r-- 1 tungtv tungtv   90980 Thg 3  13 11:46 MEDIUM.png
-rw-rw-r-- 1 tungtv tungtv 3246901 Thg 3  13 10:34 original.odt
-rw-rw-r-- 1 tungtv tungtv   14550 Thg 3  13 11:46 SMALL.png
➜  odt identify SMALL.png 
SMALL.png PNG 180x135 180x135+0+0 8-bit sRGB 14550B 0.000u 0:00.000
➜  odt identify MEDIUM.png 
MEDIUM.png PNG 424x600 424x600+0+0 8-bit sRGB 90980B 0.000u 0:00.000
➜  odt identify LARGE.png 
LARGE.png PNG 1240x1753 1240x1753+0+0 8-bit sRGB 441862B 0.000u 0:00.000

Conclusion

  • The width x height is not the same for different files.
  • We can use SMALL or MEDIUM
    thumb.zip

@quantranhong1999
Copy link
Member

The LARGE size seems not good to me. Its size is even bigger than the original attachment :p

@Arsnael
Copy link
Member Author

Arsnael commented Mar 13, 2023

@vttranlina you tried the linshare thumbnail server locally? Nice :)

LARGE is definitely way too big and not usable in our case. I feel MEDIUM is too big too honestly (but might be wrong). I think SMALL size is likely enough?

@chibenwa
Copy link
Member

Is there ways to get linthumbnail generate only small size?

@vttranlina
Copy link
Member

Is there ways to get linthumbnail generate only small size?

customize the linthumbnail image
Right now, it not support get only small size.
I just looked the source code, I think it is simple for customize

@chibenwa
Copy link
Member

Open an issue there to see if we can add a query parameter.

@vttranlina
Copy link
Member

Open an issue there to see if we can add a query parameter.

created: linagora/linshare-thumbnail-server#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants