I need something to orient the image correctly and then to appear. I'm using laravel and image intervation
<?php
$img = Image::make("{{$file->caminho}}{{$file->nome}}")-orientate();
?>
<img src="{{ $img }}"/>
But I can not
I need something to orient the image correctly and then to appear. I'm using laravel and image intervation
<?php
$img = Image::make("{{$file->caminho}}{{$file->nome}}")-orientate();
?>
<img src="{{ $img }}"/>
But I can not
For those of you who want to use image intervation and target photos, do the following
create a link to the image, in my case I'm passing the ID.
a href="user / previewLarge / {{$ file-"> id}}" >
create the route:
get ('user / preview / {fileId}', '' '' '' files.preview ',' uses '= &' 'FilesController @ preview' auth ');
create the controller
public function preview ($ fileId) {
$file = \App\Files::find($fileId);
$finalPath = $file->caminho.'/'.$file->nome;
$mime = mime_content_type($finalPath); //pega o tipo do arquivo e se for jpeg, fará o processo de orientação.
if($mime == "image/jpeg")
{
return $image = Image::make($finalPath)
->orientate()
->resize(150, 200)
->encode('data-url',0)->response();
}
else{
return $image = Image::make($finalPath)->encode('data-url',0)->response();
}
}
With me it worked, thank you all!
You're trying to use syntax blade within php , and you do not need >
to access a property or method.
<?php
$img = Image::make($file->caminho . $file->nome)->orientate();
?>