Rachael
Rachael

Reputation: 299

Laravel 4 HTML images

My question is does Laravel accept PNG images or any other format beside JPG. What is happening is when I change my image to JPG it can find it, but as soon as I change it to PNG it no longer can find the image.

{{HTML::image('images/DRCSportslogo.png', 'DRC Sports Race Management', array('id' => 'DRCS-logo'));}}

I have this image formatted in both PNG and JPG in the same file directory so I know it's not the location of the file.

Upvotes: 6

Views: 27202

Answers (4)

niko
niko

Reputation: 1

Try giving a permission to the "images" folder

Upvotes: -3

Alencar Funini
Alencar Funini

Reputation: 91

The laravel search the image in the public folder, then you should have a file public/images/DRCSportslogo.png

{{ HTML::image('images/DRCSportslogo.png', $alt="DRCSports", $attributes = array()) }}

Upvotes: 9

arma
arma

Reputation: 4124

There is no difference what you input there it can be .jpg, .png or even .exe or any other file on system.

You can see that in api page : L4 API HTML::image

Only thing i can suggest is to browse directly to the image you want to reach. In my experience sometimes ftp clients make false uploads (empty png files). That could be the case.

Upvotes: 5

kJamesy
kJamesy

Reputation: 6233

Try

<img src="{{asset('images/DRCSportslogo.png')}}" alt="DRC Sports Race Management" id="DRCS-logo" />

Upvotes: 5

Related Questions