Controller :
public function index()
{
if (!file_exists("uploads/profiles/".\Auth::User()->id.".jpeg")) {
$image_content = File::get("uploads/profiles/default.jpg");
$image = response($image_content, 200)->header('Content-Type', 'image/jpeg');
$size = getimagesize($image);
$aspectratio = $size[0]/$size[1];
$img_thumbnail = Image::make($image)->resize(50*$aspectratio,50);
$img_profile = Image::make($image)->resize(160*$aspectratio,160);
$imgname = \Auth::User()->id;
$img_thumbnail->save('uploads/thumbnails/'.$imgname.".jpeg");
$img_profile->save('uploads/profiles/'.$imgname.".jpeg");
}
Error : : failed to open stream: No such file or directory.
Actually, I want to fetch the default.jpg image and save it to two other folders with different extension.
Content-Typeheader though.