Validate maximum file size after converting audio/video file for tipline content #2046
+19
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We validate the size of a file uploaded to be the header of a newsletter or resource. But, depending on the file (for example, videos and audios) they get converted to the formats and codecs accepted by WhatsApp. It’s important to also validate the file size after converting, since in some (rare) cases they can be larger than the original file. For example, when the input file is a video that uses the H.265 codec, which is usually much lighter than the H.264 output codec.
Fixes: CV2-5326.
How has this been tested?
TDD. I added a unit test that is able to reproduce the issue. The test uses as input a H.265 video that has size ~300KB, but 1.6 MB after converting to H.264. The test sets the maximum size to 1 MB.
Checklist