parent
0db3ef43cd
commit
c83053b366
|
@ -33,6 +33,7 @@
|
|||
"ext-simplexml": "*",
|
||||
"ext-xsl": "*",
|
||||
"ext-zip": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"aluguest/ical-easy-reader": "^1.5",
|
||||
"danielstjules/stringy": "^3.1",
|
||||
"davidepastore/codice-fiscale": "^0.4.0",
|
||||
|
|
|
@ -17,7 +17,7 @@ $_SESSION['superselect']['id_categoria'] = $record['id_categoria'];
|
|||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "image", "label": "<?php echo tr('Immagine'); ?>", "name": "immagine", "class": "img-thumbnail", "value": "<?php echo $articolo->image; ?>" ]}
|
||||
{[ "type": "image", "label": "<?php echo tr('Immagine'); ?>", "name": "immagine", "class": "img-thumbnail", "value": "<?php echo $articolo->image; ?>", "accept": "image/x-png,image/gif,image/jpeg" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
|
|
|
@ -241,6 +241,10 @@ class Upload extends Model
|
|||
|
||||
$filepath = $upload->filepath;
|
||||
|
||||
if (!in_array(mime_content_type($filepath), ['image/x-png', 'image/gif', 'image/jpeg'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$driver = extension_loaded('gd') ? 'gd' : 'imagick';
|
||||
ImageManagerStatic::configure(['driver' => $driver]);
|
||||
|
||||
|
|
|
@ -406,6 +406,10 @@ class Uploads
|
|||
$fileinfo = self::fileInfo($filepath);
|
||||
$directory = empty($directory) ? dirname($filepath) : $directory;
|
||||
|
||||
if (!in_array(mime_content_type($filepath), ['image/x-png', 'image/gif', 'image/jpeg'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$driver = extension_loaded('gd') ? 'gd' : 'imagick';
|
||||
Intervention\Image\ImageManagerStatic::configure(['driver' => $driver]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue