forked from Cavemanon/cavepaintings
pull a bunch of small fixes from #659
This commit is contained in:
@ -619,7 +619,7 @@ class Image
|
||||
);
|
||||
} else {
|
||||
// check if tag has already been written
|
||||
if(in_array($id, $written_tags)) {
|
||||
if (in_array($id, $written_tags)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,9 @@ const MIME_TYPE_MAP = [
|
||||
'ogg' => 'application/ogg', 'mp3' => 'audio/mpeg', 'wav' => 'audio/x-wav',
|
||||
'avi' => 'video/x-msvideo', 'mpg' => 'video/mpeg', 'mpeg' => 'video/mpeg',
|
||||
'mov' => 'video/quicktime', 'flv' => 'video/x-flv', 'php' => 'text/x-php',
|
||||
'mp4' => 'video/mp4', 'ogv' => 'video/ogg', 'webm' => 'video/webm'
|
||||
'mp4' => 'video/mp4', 'ogv' => 'video/ogg', 'webm' => 'video/webm',
|
||||
'webp' => 'image/webp', 'bmp' =>'image/x-ms-bmp', 'psd' => 'image/vnd.adobe.photoshop',
|
||||
'mkv' => 'video/x-matroska'
|
||||
];
|
||||
|
||||
/**
|
||||
@ -309,7 +311,7 @@ function getMimeType(string $file, string $ext=""): string
|
||||
return 'application/octet-stream';
|
||||
}
|
||||
|
||||
function getExtension(?string $mime_type): ?string
|
||||
function get_extension(?string $mime_type): ?string
|
||||
{
|
||||
if (empty($mime_type)) {
|
||||
return null;
|
||||
|
@ -281,20 +281,20 @@ function manual_include(string $fname): ?string
|
||||
function path_to_tags(string $path): string
|
||||
{
|
||||
$matches = [];
|
||||
$tags = "";
|
||||
if(preg_match("/\d+ - (.*)\.([a-zA-Z0-9]+)/", basename($path), $matches)) {
|
||||
$tags = "";
|
||||
if (preg_match("/\d+ - (.*)\.([a-zA-Z0-9]+)/", basename($path), $matches)) {
|
||||
$tags = $matches[1];
|
||||
}
|
||||
|
||||
$dir_tags = dirname($path);
|
||||
$dir_tags = str_replace("/", " ", $dir_tags);
|
||||
$dir_tags = str_replace("__", " ", $dir_tags);
|
||||
$dir_tags = trim($dir_tags);
|
||||
if ($dir_tags != "") {
|
||||
$tags = trim($tags)." ".trim($dir_tags);
|
||||
}
|
||||
$tags = trim ( $tags );
|
||||
|
||||
}
|
||||
|
||||
$dir_tags = dirname($path);
|
||||
$dir_tags = str_replace("/", " ", $dir_tags);
|
||||
$dir_tags = str_replace("__", " ", $dir_tags);
|
||||
$dir_tags = trim($dir_tags);
|
||||
if ($dir_tags != "") {
|
||||
$tags = trim($tags)." ".trim($dir_tags);
|
||||
}
|
||||
$tags = trim($tags);
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user