Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 826
Rachael Avatar asked Jun 05 '13 14:06

Rachael


3 Answers

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()) }}
like image 75
Alencar Funini Avatar answered Nov 02 '22 00:11

Alencar Funini


Try

<img src="{{asset('images/DRCSportslogo.png')}}" alt="DRC Sports Race Management" id="DRCS-logo" />
like image 5
kJamesy Avatar answered Nov 02 '22 00:11

kJamesy


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.

like image 5
arma Avatar answered Nov 02 '22 02:11

arma