webapp icon indicating copy to clipboard operation
webapp copied to clipboard

1077 Set 4MB size limit for images

Open tomaszsmy opened this issue 2 years ago • 4 comments

#1077

tomaszsmy avatar Aug 03 '22 17:08 tomaszsmy

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (5f0f06c) 13.73% compared to head (ce38557) 13.85%.

Files Patch % Lines
...u/web/content/multimedia/image/ImageComponent.java 5.12% 37 Missing :warning:
...ontent/multimedia/image/ImageCreateController.java 0.00% 1 Missing :warning:
.../content/multimedia/image/ImageEditController.java 0.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1605      +/-   ##
============================================
+ Coverage     13.73%   13.85%   +0.11%     
- Complexity      453      455       +2     
============================================
  Files           257      258       +1     
  Lines          8503     8476      -27     
  Branches        881      873       -8     
============================================
+ Hits           1168     1174       +6     
+ Misses         7284     7250      -34     
- Partials         51       52       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 03 '22 18:08 codecov[bot]

@tomaszsmy Do you think we should also reduce from 10MB to 4MB in Image.java?

https://github.com/elimu-ai/webapp/blob/bf77a8f30d9996ba92ea917db68e5bb6ffceb8c0/src/main/java/ai/elimu/model/content/multimedia/Image.java#L19

nya-elimu avatar Aug 21 '22 04:08 nya-elimu

@tomaszsmy Do you think we should also reduce from 10MB to 4MB in Image.java?

https://github.com/elimu-ai/webapp/blob/bf77a8f30d9996ba92ea917db68e5bb6ffceb8c0/src/main/java/ai/elimu/model/content/multimedia/Image.java#L19

I think that the change may cause error if in table are any data which has size > 4MB

tomaszsmy avatar Aug 21 '22 14:08 tomaszsmy

I think that the change may cause error if in table are any data which has size > 4MB

@tomaszsmy Good point! And you're right, yes we do:

[webapp-eng]> SELECT id, LENGTH(bytes) FROM Image WHERE LENGTH(bytes) > 4194304;
+-----+---------------+
| id  | LENGTH(bytes) |
+-----+---------------+
|   4 |       4901733 |
| 449 |       6144932 |
+-----+---------------+
2 rows in set (0.05 sec)

So we should leave it at 10MB.

nya-elimu avatar Aug 27 '22 07:08 nya-elimu