File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -87,30 +87,30 @@ $image->save('image2.jpg');
87
87
This will cause your image to skew if you do not use the same width/height ratio as the source image.
88
88
89
89
Loading and saving images from string
90
- ----------
90
+ -------------------------------------
91
91
92
92
To load an image from a string:
93
93
94
94
``` php
95
- $image = ImageResize::createFromString(base64_decode('R0lGODlhDwAPAKECAAAAzMzM /////wAAACwAAAAADwAPAAACIISPeQHsrZ5ModrLlN48CXF8m2iQ3YmmKqVlRtW4MLwWACH+H09wdGltaXplZCBieSBVbGVhZCBTbWFydFNhdmVyIQAAOw =='));
95
+ $image = ImageResize::createFromString(base64_decode('R0lGODlhAQABAIAAAAQCBP ///yH5BAEAAAEALAAAAAABAAEAAAICRAEAOw =='));
96
96
$image->scale(50);
97
97
$image->save('image.jpg');
98
98
```
99
99
100
100
You can also return the result as a string:
101
101
102
102
``` php
103
- $image = ImageResize::createFromString(base64_decode('R0lGODlhDwAPAKECAAAAzMzM /////wAAACwAAAAADwAPAAACIISPeQHsrZ5ModrLlN48CXF8m2iQ3YmmKqVlRtW4MLwWACH+H09wdGltaXplZCBieSBVbGVhZCBTbWFydFNhdmVyIQAAOw =='));
103
+ $image = ImageResize::createFromString(base64_decode('R0lGODlhAQABAIAAAAQCBP ///yH5BAEAAAEALAAAAAABAAEAAAICRAEAOw =='));
104
104
$image->scale(50);
105
- $result = $image->get ();
105
+ echo $image->getImageAsString ();
106
106
```
107
107
108
108
Magic ` __toString() ` is also supported:
109
109
110
110
``` php
111
- $image = ImageResize::createFromString(base64_decode('R0lGODlhDwAPAKECAAAAzMzM /////wAAACwAAAAADwAPAAACIISPeQHsrZ5ModrLlN48CXF8m2iQ3YmmKqVlRtW4MLwWACH+H09wdGltaXplZCBieSBVbGVhZCBTbWFydFNhdmVyIQAAOw =='));
111
+ $image = ImageResize::createFromString(base64_decode('R0lGODlhAQABAIAAAAQCBP ///yH5BAEAAAEALAAAAAABAAEAAAICRAEAOw =='));
112
112
$image->resize(10, 10);
113
- $result = (string)$image;
113
+ echo (string)$image;
114
114
```
115
115
116
116
Displaying
You can’t perform that action at this time.
0 commit comments