-
Notifications
You must be signed in to change notification settings - Fork 178
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it continue working if we pass Integer.MAX_VALUE
?
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 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.