Skip to content

Commit 938f6ab

Browse files
Rohit MishraRohit Mishra
authored andcommitted
Updated the README file
1 parent 215a1d2 commit 938f6ab

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,24 @@ For example, if you want to crop an image (with width as 300 and height as 400),
9494

9595
[Read Image Delivery API documentation](https://www.contentstack.com/docs/apis/image-delivery-api/).
9696

97-
Following are Image Delivery API examples.
97+
You can use the Image Delivery API functions in this SDK as well. Here are a few examples of its usage in the SDK.
9898

99-
// set the quality 100
100-
$imageUrl = $stack->ImageTrasform($imageUrl, array('quality'=> 100));
99+
// set the image quality to 100
100+
imageUrl = Stack->imageTransform(imageUrl, array(
101+
'quality'=> 100
102+
));
103+
104+
// resize the image by specifying width and height
105+
imageUrl = Stack->imageTransform(imageUrl, array(
106+
'width'=> 100,
107+
'height'=> 100
108+
));
109+
110+
// enable auto optimization for the image
111+
imageUrl = Stack.imageTransform(imageUrl, array(
112+
'auto'=> 'webp'
113+
))
101114

102-
// set the quality to 100, auto optimization, width and height
103-
$imageUrl = $stack->ImageTrasform($imageUrl, array('quality'=> 100,
104-
'auto'=> 'webp',
105-
'width'=> 100,
106-
'height'=> 100));
107115

108116

109117
### Helpful Links

0 commit comments

Comments
 (0)