Added more customization options for generating different types of im…#1305
Added more customization options for generating different types of im…#1305
Conversation
…ages with different dimensions.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1305 +/- ##
============================================
- Coverage 91.76% 91.70% -0.07%
- Complexity 3081 3082 +1
============================================
Files 310 310
Lines 6038 6078 +40
Branches 628 631 +3
============================================
+ Hits 5541 5574 +33
- Misses 341 345 +4
- Partials 156 159 +3 ☔ View full report in Codecov by Sentry. |
| BMP("image/bmp"), | ||
| GIF("image/gif"), | ||
| JPEG("image/jpeg"), | ||
| PNG("image/png"), | ||
| SVG("image/svg+xml"), | ||
| TIFF("image/tiff"); |
There was a problem hiding this comment.
do we really need image/ prefix for every item?
May be just add it once in get method or in constructor of enum?
There was a problem hiding this comment.
Well, no, we wouldn't really need it, but the field is called mimetype, which is why you have of these duplication, but without the image/ part it wouldn't be a mimetype, it would be..... ?
There was a problem hiding this comment.
I guess if you replace constructor with
ImageType(String type) {
this.mimeType = "images/" + type;
} the field would be still mimeType however less duplication
| } | ||
| } | ||
|
|
||
| public record Base64ImageRuleConfig(ImageType imageType, int width, int height) { } |
There was a problem hiding this comment.
Will it continue working if we pass Integer.MAX_VALUE ?
There was a problem hiding this comment.
I haven't tried, but most likely it wouldn't. Then again how often would you create an image of 2147483647 x 2147483647? Seems quite the picture, but I don't see a really good reason to limit it to any arbitrary value, I'd call that user error.
…ages with different dimensions.