forked from openfoodfacts/openfoodfacts-dart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new web folder structure for images
Deleted file: * `suggestion_manager.dart`: unrelated removal of deprecated code Impacted files: * `image_helper.dart`: unrelated removal of deprecated code * `json_helper.dart`: unrelated removal of deprecated code * `open_food_api_client.dart`: unrelated removal of deprecated code * `openfoodfacts.dart`: unrelated removal of deprecated code * `pnns_groups.dart`: unrelated removal of deprecated code * `status.dart`: unrelated removal of deprecated code * `uri_helper.dart`: new web folder structure for images
- Loading branch information
1 parent
5d13faf
commit 013d6d1
Showing
8 changed files
with
14 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,8 @@ | ||
import 'open_food_api_configuration.dart'; | ||
import 'uri_helper.dart'; | ||
import '../model/product_image.dart'; | ||
|
||
/// Helper class related to product pictures | ||
class ImageHelper { | ||
/// Minimum accepted width for an uploaded image. | ||
static const int minimumWidth = 640; | ||
|
||
/// Minimum accepted height for an uploaded image. | ||
static const int minimumHeight = 160; | ||
|
||
/// Returns the [image] full url - for a specific [imageSize] if needed. | ||
/// | ||
/// E.g. "https://images.openfoodfacts.org/images/products/359/671/046/2858/front_fr.4.100.jpg" | ||
// TODO: deprecated from 2023-11-25; remove when old enough | ||
@Deprecated('Use ProductImage.getUrl instead') | ||
static String getLocalizedProductImageUrl( | ||
final String barcode, | ||
final ProductImage image, { | ||
final ImageSize? imageSize, | ||
final UriProductHelper uriHelper = uriHelperFoodProd, | ||
}) => | ||
image.getUrl(barcode, uriHelper: uriHelper, imageSize: imageSize); | ||
|
||
/// Returns the [image] full url for an uploaded ("raw") image. | ||
/// | ||
/// E.g. "https://images.openfoodfacts.org/images/products/359/671/046/2858/1.400.jpg" | ||
// TODO: deprecated from 2023-11-25; remove when old enough | ||
@Deprecated('Use ProductImage.getUrl instead') | ||
static String getUploadedImageUrl( | ||
final String barcode, | ||
final int imageId, | ||
final ImageSize imageSize, { | ||
final UriProductHelper uriHelper = uriHelperFoodProd, | ||
}) => | ||
ProductImage.raw(imgid: imageId.toString(), size: imageSize).getUrl( | ||
barcode, | ||
uriHelper: uriHelper, | ||
); | ||
|
||
/// Returns the [image] filename - for a specific [imageSize] if needed. | ||
/// | ||
/// By default uses the own [image]'s size field. | ||
/// E.g. "front_fr.4.100.jpg" | ||
/// cf. https://github.com/openfoodfacts/smooth-app/issues/3065 | ||
// TODO: deprecated from 2023-11-25; remove when old enough | ||
@Deprecated('Use ProductImage.getUrlFilename instead') | ||
static String getProductImageFilename( | ||
final ProductImage image, { | ||
final ImageSize? imageSize, | ||
}) => | ||
image.getUrlFilename(imageSize: imageSize); | ||
|
||
/// Returns the filename of an uploaded image. | ||
/// | ||
/// cf. https://github.com/openfoodfacts/smooth-app/issues/3065 | ||
// TODO: deprecated from 2023-11-25; remove when old enough | ||
@Deprecated('Use ProductImage.getUrlFilename instead') | ||
static String getUploadedImageFilename( | ||
final int imageId, | ||
final ImageSize imageSize, | ||
) => | ||
ProductImage.raw( | ||
imgid: imageId.toString(), | ||
size: imageSize, | ||
).getUrlFilename(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters