image: add symlink support (#1)

This commit is contained in:
qxb3 2024-12-09 02:53:39 +08:00 committed by GitHub
parent cc95e5babc
commit fb2c026864
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,7 @@ Hyprgraphics::CImage::CImage(const std::string& path) : filepath(path) {
mime = "image/jxl"; mime = "image/jxl";
} else { } else {
// magic is slow, so only use it when no recognized extension is found // 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); magic_load(handle, nullptr);
const auto type_str = std::string(magic_file(handle, path.c_str())); const auto type_str = std::string(magic_file(handle, path.c_str()));