I'm trying to upload image to my localhost right now. It had no problem, If it's a small image(Not over 1 MB). But when i try uploading about 3MB Image. Php said
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18048 bytes) in C:\Users\Tharit\Desktop\Work\Pixelbar\Code\ecompro\vendor\intervention\image\src\Intervention\Image\Gd\Decoder.php on line 115
It shouldn't be this much.This is code,in image upload part.
if (Input::hasFile('profile_picture'))
{
$old_profile_pic= $user->profile_pic;
$profile_picture = Input::file('profile_picture');
$profile_picture_size=getimagesize($profile_picture);
if($profile_picture_size[0]>$profile_picture_size[1])
{
$mainside = $profile_picture_size[1];
$cordx=($profile_picture_size[0]-$profile_picture_size[1])/2;
$cordx=(int) $cordx;
$cordy=0;
}
else
{
$mainside = $profile_picture_size[0];
$cordy=($profile_picture_size[1]-$profile_picture_size[0])/2;
$cordy=(int) $cordy;
$cordx=0;
}
$filename = time() .$user->id . '.' . $profile_picture->getClientOriginalExtension();
$path = public_path('img/user/' . $filename);
Image::make($profile_picture->getRealPath())
->crop($mainside,$mainside,$cordx , $cordy)
->resize(100, 100)
->save($path);
$user->profile_pic = 'img/user/'.$filename;
if($old_profile_pic != 'img/user/default_profile.gif')
{$imagecheck=1;}
}