diff --git a/README.md b/README.md index 193fbf4..6519251 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,35 @@ module.exports.img = createHandler({ Deploy it to GCP using Node.js v12+ runtime and configure a CDN on top of it. +## Resizing and cropping images + +You can resize and crop images in order to match the graphic design of your web +site or mobile application. Whether images are uploaded in your server-side code +or by your users, the original hi-res images are stored in the cloud for further +processing and management. You can then dynamically create multiple resized, +cropped and manipulated images on-the-fly and deliver them via dynamic URLs. + +To change the size of a image, use the `width` and `height` parameters (`w` and +`h` in URLs) to assign new values. You can resize the image by using both the +width and height parameters or with only one of them: the other dimension is +automatically updated to maintain the aspect ratio. + +Examples of resizing the uploaded jpg image named `sample`: + +1. Resizing the height to 200 pixels, maintaining the aspect ratio: + +
+
+ https://i.kriasoft.com/h_200/sample.jpg
+
+
+ https://i.kriasoft.com/w_200,h_100/sample.jpg
+
-
+
https://i.kriasoft.com/brown_sheep.jpg
-
+
https://i.kriasoft.com/x_355,y_410,w_300,h_200,c_crop/brown_sheep.jpg
-
+
https://i.kriasoft.com/x_355,y_410,w_300,h_200,c_crop/w_150,h_100,c_scale/brown_sheep.jpg