-
-
Notifications
You must be signed in to change notification settings - Fork 67
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: #304 - new method setProductImageAngle #309
feat: #304 - new method setProductImageAngle #309
Conversation
Deleted file: * `corn_da.jpg` Impacted files: * `api_addProductImage_test.dart`: added a test for `OpenFoodAPIClient.setProductImageAngle`; removed a duplicate test * `JsonHelper.dart`: decoded new fields `imgid` and `angle` for product `'images`'' * `openfoodfacts.dart`: new method `setProductImageAngle` * `ProductImage.dart`: added `enum ImageAngle`; added `imgid` and `angle` to `ProductImage` * `UriHelper.dart`: unrelated refactoring
Impacted files: * `api_addProductImage_test.dart`: added a test for `OpenFoodAPIClient.setProductImageCrop`; minor refactoring * `ImageHelper.dart`: added methods `getProductImageRootUrl` and `getProductImageFilename`; minor refactoring * `JsonHelper.dart`: populated crop fields of `ProductImage` for product `'images'`; minor refactoring * `openfoodfacts.dart`: added method `setProductImageCrop`; minor refactoring * `ProductHelper.dart`: minor refactoring * `ProductImage.dart`: added crop fields `coordinatesImageSize`, `x1`, `y1`, `x2` and `y2` to `ProductImage`
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.
Thanks @monsieurtanuki, I have nothing major to put out, but please have a look at my comments
lib/model/ProductImage.dart
Outdated
|
||
String get degreesClockwise => _DEGREES_CLOCKWISE[this]?.toString() ?? '0'; | ||
|
||
static ImageAngle? fromInt(final int? angle) { |
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.
Maybe a comment here that it only allow 0, 90, 170 and 270
image.rev.toString() + | ||
'.' + | ||
image.size.toNumber() + | ||
'.jpg'; |
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.
Does the server allow other types then .jpg
Impacted file: * `ProductImage.dart`
Thank you @M123-dev for your code review! Yes it's always |
Deleted file:
corn_da.jpg
Impacted files:
api_addProductImage_test.dart
: added a test forOpenFoodAPIClient.setProductImageAngle
; removed a duplicate testJsonHelper.dart
: decoded new fieldsimgid
andangle
for product'images'
openfoodfacts.dart
: new methodsetProductImageAngle
ProductImage.dart
: addedenum ImageAngle
; addedimgid
andangle
toProductImage
UriHelper.dart
: unrelated refactoring