core: fix symlinked images not picking up extension (#473)

This commit is contained in:
Darko Nikolić 2024-08-31 12:37:47 +02:00 committed by GitHub
parent 9c1e9e7db2
commit cc71c0b7d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ FileType getFileType(const std::filesystem::path& path) {
ft = FileType::WEBP;
else {
// magic is slow, so only use it when no recognized extension is found
auto handle = magic_open(MAGIC_NONE | MAGIC_COMPRESS);
auto handle = magic_open(MAGIC_NONE | MAGIC_COMPRESS | MAGIC_SYMLINK);
magic_load(handle, nullptr);
const auto type_str = std::string(magic_file(handle, path.c_str()));