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

1077 Set 4MB size limit for images #1605

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

tomaszsmy
Copy link
Contributor

@tomaszsmy tomaszsmy commented Aug 3, 2022

@tomaszsmy tomaszsmy requested a review from a team as a code owner August 3, 2022 17:56
@tomaszsmy tomaszsmy requested review from jo-elimu, vrudas and sshivaditya2019 and removed request for a team August 3, 2022 17:56
@codecov
Copy link

codecov bot commented Aug 3, 2022

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 ⚠️
...ontent/multimedia/image/ImageCreateController.java 0.00% 1 Missing ⚠️
.../content/multimedia/image/ImageEditController.java 0.00% 1 Missing ⚠️
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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nya-elimu nya-elimu self-requested a review August 21, 2022 04:20
@nya-elimu
Copy link
Member

nya-elimu commented Aug 21, 2022

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

@tomaszsmy tomaszsmy self-assigned this Aug 21, 2022
@tomaszsmy
Copy link
Contributor Author

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

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

@nya-elimu
Copy link
Member

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.

Copy link
Member

@nya-elimu nya-elimu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me 🙂

Can you also add the same restriction to the ImageEditController?

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

Successfully merging this pull request may close these issues.

None yet

3 participants