Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tnort's avatar
Level 4

Resize image before store

Hi all,

Need some help with resizing an image before storing it.

I have deployed my application on GoDaddy and I get an error when trying to access the updated image in order to resize it.

error: Image source not readable

<-- PHP

 if ($request->has('image')) {
        $imagePath = $request['image']->store('uploads', 'public');
        $image = Image::make(public_path("storage/{$imagePath}"))->fit(2200, 1000);
        $image->save();
    } else {
        $imagePath = 'uploads/banner.jpg';
    }

-->

I was thinking is something to do with the privacy of the folder store.

<-- PHP

    if ($request->has('image')) {

        $image = Image::make($data['image'])->fit(2200, 1000);

        $image->save();

        $imagePath = $image->store('uploads', 'public');

    } else {

        $imagePath = 'uploads/banner.jpg';

    }

-->

I am trying to resize uploaded image before storing but I get an error Command (Store) is not available for driver (Gd).

anyone encountered this issue before, thank you!

0 likes
1 reply
tnort's avatar
tnort
OP
Best Answer
Level 4

Solved it.

the public_path had to be removed.

Please or to participate in this conversation.