-
Notifications
You must be signed in to change notification settings - Fork 79
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
Resolve issue CRJVM204 [Team 1.5] #153
Resolve issue CRJVM204 [Team 1.5] #153
Conversation
Kudos, SonarCloud Quality Gate passed! |
Issue #105 |
This PR has been automatically marked as stale because it has no activity for 30 days. |
hi @nouk-pl, |
This PR has been automatically marked as stale because it has no activity for 30 days. |
core-team decision : not applicable as described |
Sorry, I'm coming late to the discussion of this proposed rule. Imposing SVG as the only valid format is not relevant. Indeed, SVG can only be used for specific kind of images (those presenting drawings or solid colors: e.g. icons, logos). A photographic illustration will be of much better quality for a lower size by remaining in a “bitmap” format (eg: JPG, WebP). Here is an example with the image used on the home page of https://www.greenpeace.fr/ : Original Bitmap image in JPG (75 ko -> 73 ko through HTTP GZIP) : Vectorized Image in SVG (2,3 Mo -> 1,9 Mo through HTTP GZIP) : The context and applicability of this rule need to be much better clarified. |
PR (and linked issue) closed, for now, because not applicable like that : see explanation above. |
Resolved issue CRJVM204
Summary
Because SVGs are generally smaller than other image format, they’re less taxing on your server despite needing to render on load. So we recommended, when it is possible, to use svg format image over other image format.
SVG are vector image, they can be compress without any loss, witch means that they're compressible to smaller file sizes at no cost to their definition, detail, or quality. PNGs also benefit from lossless compression of 5-20%, which can help make up for their large file size. However, they're still likely to be larger than an SVG.
SVGs are also scalable and will render pixel-perfect at any resolution whereas JPEGs, PNGs and GIFs will not.
How it work ?
To check if a not recommended image format are used in Java code, we check string literal to verify if a not recommended extension is used. If so, an issue is raised.
On SonarQube
The render of an issue explanation :