Cropping Image from path

I have a function that saves image path to database.

now i want to make a thumb

considering the path saved in the db is image.png and the image is stored in assets/uploads

foreach($results as $result) {
  <img src="assets/uploads/'.thumb($result->image(), array('width' => 200))->filename().'">

i tried that but i doesn’t crop or make thumb

The thumb function expects an image or media object. So before you can use it, you have to turn your image into one. You can do it like this

$myimage = new Asset('assets/images/myimage.jpg');
  echo thumb($myimage, array('width' => 300));

Replace myimage.jpg with your filename from the database.