Commit 9152379b authored by hlarget's avatar hlarget 👹
Browse files

Merge branch 'release/2.1.1'

parents f1513f24 418f3e3b
......@@ -27,12 +27,12 @@ class ResourceController extends AbstractController
// so we have to decode it
$url = base64_decode($request->query->get("url"));
$resize = $request->query->get("resize", "fit");
$width = $request->query->get("width", "300");
$height = $request->query->get("height", "300");
$width = $request->query->get("width", "0");
$height = $request->query->get("height", "0");
$gravity = $request->query->get("gravity", "ce");
$enlarge = $request->query->get("enlarge", 1);
//If we don't provide the defaultExtension parameter, we transform the image to png by default
$extension = $request->query->get("defaultExtension", false) ? null : "png";
$extension = $request->query->get("useDefaultExtension", false) ? null : "png";
$path = $imgProxyClient->getResourceUrl($url, $resize, $width, $height, $gravity, $enlarge, $extension);
......
......@@ -131,6 +131,21 @@ security:
After this you should connect to your application and call the routes in this bundle to call Konnect.
You can find RAML documentation [on dev-documentation.](https://doc.agoods.fr/v2/api/konnectBundle.html).
### img-proxy
The route `/konnect/resource` is available to serve resources from our own img-proxy server (uri set with the `IMGPROXY_URI` env key).
It accepts some query parameters to configure the way we are serving the resource :
- `url` : the url of the resource
- `resize` : (default `'fit'`) The resize parameter of the image. Can be 'fit', 'fill', or 'auto'.
See [the img-proxy documentation about resize](https://docs.imgproxy.net/#/generating_the_url_advanced?id=resizing-type)
- `width` : (default `'0'`, the original width) The width of the image, in pixels
- `height` : (default `'0'`, the original height) The height of the image, in pixels
- `gravity` : (default `'ce'`) When img-proxy needs to cut some parts of the image, it is guided by the gravity.
See [the img-proxy documentation about gravity](https://docs.imgproxy.net/#/generating_the_url_basic?id=gravity)
- `enlarge` : (default `1`) When set to 1, t or true, img-proxy will enlarge the image if it is smaller than the given size.
See [the img-proxy documentation about enlarge](https://docs.imgproxy.net/#/generating_the_url_basic?id=enlarge)
- `useDefaultExtension` : (default `false`) Boolean to determine whether we should reformat the image (`false`) or use the default extension of the resource (`true`)
## Use this library in an empty Symfony project
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment