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

haizone's avatar

Image source not readable - with image.intervention packege

hi i use this packege: http://image.intervention.io

and i cant to upload this image from URL:

this is my code:

            $img =      Image::make('url')->encode('jpg');
        $img->save(public_path('images/upload/') .'dgf.jpg');

and its didnt work shomeone can help me to fix that

thanks :)

0 likes
5 replies
Cronix's avatar

What does "it didnt work" mean? Are there errors?

rin4ik's avatar

I think here should be coma

      $img->save(public_path('images/upload') ,'dgf.jpg');
jlrdw's avatar

What does "it didnt work" mean?

Means it did not work. Sorry couldn't help myself.

haizone's avatar

@Cronix the url its didnt make it like an image link look here:

this is didnt work: http://prntscr.com/j302bx

but this is work: http://prntscr.com/j302qe

but i get the url from my DB and i get this like is the first image when i copy the link to chrome and enter the url and after that copy the url its look like the second pic and its work

how i can do that work id the first pic

Cronix's avatar

@rin4ik No, the 2nd argument to save() is the quality/compression of the image as a percent. http://image.intervention.io/api/save

I think it's because you aren't giving it a filename to save it as. You're just giving it a path. try something like:

$imageName = 'myimage.dgf.jpg';
$img->save(public_path('images/upload/' . $imageName));

Please or to participate in this conversation.