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
feat: add banner support for communities #2687
Conversation
Hey @stefandunca, and thank you so much for making your first pull request in status-go! ❤️ Please help us make your experience better by filling out this brief questionnaire https://goo.gl/forms/uWqNcVpVz7OIopXg2 |
Pull Request Checklist
|
Jenkins BuildsClick to see older builds (12)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A few points nothing major. One thing that I don't see is any tests for the banner functionality, do you feel confident in adding these?
2988bca
to
e3cc5e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... I don't see is any tests for the banner functionality, do you feel confident in adding these?
@Samyoul, how about I add integration tests to check that banner image processing respects the imposed size limits? However, that means working with big images, which might make tests longer than a few milliseconds. Is this a problem?
Do you have anything else in mind for the test scope?
Also, I'm not familiar with image processing in go. Any hints on what should I use to generate input test images so that I don't pollute the test source code with big files?
Perhaps check the |
@Samyoul, I did all the requested changes, so please go ahead and have another look. Also, after some tests with different compression quality, base resolution, and image complexity and talking to @John-44 I raised the ideal image quality to 300KB, which is an edge case, to target maximum quality. I also changed the behaviour for banners not to upscale to target quality but only shrink if necessary. We can handle the upscaling in the UIs and save some space/traffic. |
Add banner image as a special `IdentityImage` beside "thumbnail" and "large" Banner input cropped image processing - Resize to keep in the limits of `BannerDim` - Encode to match the file size limits define for banner - Don't scale up. This can be done efficiently in the UI Changes to `images` module - Refactor `EncodeToBestSize` as `EncodeToLimits` to accept arbitrary dimensions and allow for custom size - Define `DimensionLimits` for banner not to exceed 450 KB and a rough estimate for the ideal size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, looks good
Add banner image as a special "banner"
IdentityImage
beside "thumbnail" and "large"Changes to
images
moduleEncodeToBestSize
asEncodeToLimits
to accept arbitrary dimmensions to allow for custom sizeDimensionLimits
for banner not to exceed 450 KBCloses status-desktop #5403