mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Limit enterprise image sizes on DFC API
Uploaded images can be several MB in size. While offering the big size would enable other apps to resize it and store the image size they need, we have only one app using it in practice and it's using the image directly. It's much simpler and if a default size will work for others in the future then why not just serve that. We can revise this in the future. There is a DFC discussion about publishing several sizes which I started: https://github.com/datafoodconsortium/ontology/discussions/77#discussioncomment-8228094
This commit is contained in:
@@ -29,8 +29,8 @@ class EnterpriseBuilder < DfcBuilder
|
||||
# But that would require a new endpoint for a single string.
|
||||
add_ofn_property(e, "ofn:contact_name", enterprise.contact_name)
|
||||
|
||||
add_ofn_property(e, "ofn:logo_url", enterprise.logo.url)
|
||||
add_ofn_property(e, "ofn:promo_image_url", enterprise.promo_image.url)
|
||||
add_ofn_property(e, "ofn:logo_url", enterprise.logo_url(:small))
|
||||
add_ofn_property(e, "ofn:promo_image_url", enterprise.promo_image_url(:large))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -377,8 +377,8 @@ paths:
|
||||
dfc-b:supplies: http://test.host/api/dfc/enterprises/10000/supplied_products/10001
|
||||
ofn:long_description: "<p>Hello, world!</p><p>This is a paragraph.</p>"
|
||||
ofn:contact_name: Fred Farmer
|
||||
ofn:logo_url: http://www.example.com/rails/active_storage/url/logo.png
|
||||
ofn:promo_image_url: http://www.example.com/rails/active_storage/url/promo.png
|
||||
ofn:logo_url: http://test.host/rails/active_storage/url/logo.png
|
||||
ofn:promo_image_url: http://test.host/rails/active_storage/url/promo.png
|
||||
dfc-b:affiliates: http://test.host/api/dfc/enterprise_groups/60000
|
||||
- "@id": http://test.host/api/dfc/addresses/40000
|
||||
"@type": dfc-b:Address
|
||||
|
||||
Reference in New Issue
Block a user