//original uploaded image size $imgsize = @getimagesize($file); $w = $imgsize[0]; $h = $imgsize[1]; $thumb1h = 300; $thumb1w = ($w*$thumb1h)/$h; $thumbname1 = "image-" . round($thumb1w) . 'x' . $thumb1h . '-' . $originalfn; $thumb2h = 140; $thumb2w = ($w*$thumb2h)/$h; $thumbname2 = "image-" . round($thumb2w) . 'x' . $thumb2h . '-' . $originalfn; Image::load($file) ->config('quality', 100) ->crop_resize($thumb1w, $thumb1h) ->save($uploaddir . DIRECTORY_SEPARATOR . $thumbname1); Image::load($file) ->config('quality', 100) ->crop_resize($thumb2w, $thumb2h) ->save($uploaddir . DIRECTORY_SEPARATOR . $thumbname2);
It looks like you're new here. If you want to get involved, click one of these buttons!