Welcome Guest, Not a member yet? Register   Sign In
Use of Image Manipulation class in news app
#1

In this demo: https://codeigniter.com/user_guide/tutor...ction.html I have add a line to show photo of news:


PHP Code:
<img src="<?=site_url('../fotografias/'.($news_item['filename']))?>"


But now I want to crop it and I don't know how use Image manipulation class

PHP Code:
$image = \Config\Services::image()
        ->withFile('/path/to/image/mypic.jpg')
        ->reorient()
        ->rotate(90)
        ->crop(10010000)
        ->save('/path/to/image/mypic_thumb.jpg'); 

Any idea?. I try to create a function, but I allways get error
Reply




Theme © iAndrew 2016 - Forum software by © MyBB