File tree Expand file tree Collapse file tree
user_guide_src/source/libraries/images Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
22
3- $ image = \Config \Services::image ()
4- ->withFile ('/path/to/image/mypic.jpg ' )
3+ $ image ->withFile ('/path/to/image/mypic.jpg ' )
54 ->fit (100 , 100 , 'center ' )
65 ->save ('/path/to/image/mypic_thumb.jpg ' );
Original file line number Diff line number Diff line change 11<?php
22
3- $ image = \Config \Services::image ()
4- ->withFile ('/path/to/image/mypic.jpg ' )
3+ $ image ->withFile ('/path/to/image/mypic.jpg ' )
54 ->reorient ()
65 ->rotate (90 )
76 ->crop (100 , 100 , 0 , 0 )
Original file line number Diff line number Diff line change 11<?php
22
3- $ image = \Config \Services::image ()
4- ->withFile ('/path/to/image/mypic.jpg ' )
3+ $ image ->withFile ('/path/to/image/mypic.jpg ' )
54 // processing methods
65 ->save ('/path/to/image/my_low_quality_pic.jpg ' , 10 );
Original file line number Diff line number Diff line change 11<?php
22
3- $ image = \Config \Services::image ()
4- ->withFile ('/path/to/image/mypic.jpg ' )
3+ $ image ->withFile ('/path/to/image/mypic.jpg ' )
54 ->withResource ()
65 ->save ('/path/to/image/my_low_quality_pic.jpg ' , 10 );
Original file line number Diff line number Diff line change 11<?php
22
3+ $ image = \Config \Services::image ();
4+
35try {
4- $ image = \Config \Services::image ()
5- ->withFile ('/path/to/image/mypic.jpg ' )
6+ $ image ->withFile ('/path/to/image/mypic.jpg ' )
67 ->fit (100 , 100 , 'center ' )
78 ->save ('/path/to/image/mypic_thumb.jpg ' );
8- } catch (CodeIgniter \Images \ImageException $ e ) {
9+ } catch (CodeIgniter \Images \Exceptions \ ImageException $ e ) {
910 echo $ e ->getMessage ();
1011}
You can’t perform that action at this time.
0 commit comments