finfo_file
Intervention/image
Supported Versions: PHP >= 5.3.0, PHP 7, PHP 8, PECL fileinfo >= 0.1.0
Return information about a file
finfo_file
(
finfo $finfo
,
string $filename
,
int $flags
=
FILEINFO_NONE
,
?
resource $context
=
null
):
string
|
false
$this
->
filename
=
array_key_exists
(
'filename'
,
$info
) ?
$info
[
'filename'
] :
null
;
if (
file_exists
(
$path
) &&
is_file
(
$path
)) {
$this
->
mime
=
finfo_file
(
finfo_open
(
FILEINFO_MIME_TYPE
),
$path
);
}
return
$this
;
src/Intervention/Image/File.php
}
$mime
=
finfo_file
(
finfo_open
(
FILEINFO_MIME_TYPE
),
$path
);
switch (
strtolower
(
$mime
)) {
src/Intervention/Image/Gd/Decoder.php