image icon indicating copy to clipboard operation
image copied to clipboard

Camera upload picture rotate (I already tried everything in SO & GitHub solution too)

Open GergoKormoczy opened this issue 3 years ago • 0 comments

I tried every single solution but still rotate my images after camera upload.

$this->validate($request, [
            'background-picture' => 'required|image|mimes:jpeg,png,jpg,gif'
        ]);

        $file = $request->file('background-picture');
        $filePath = 'images/background-picture/' . Hashids::encode($id) . '.jpg';

        $image = Image::make($file->getRealPath());
        $image->orientate();
        $image->fit(720, 440);
        Storage::disk('public')->put($filePath, $image->encode());

        return redirect()->route('main');``

GergoKormoczy avatar Feb 24 '22 21:02 GergoKormoczy