18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 08:04:57 +01:00

Merge pull request #362 from MaSzyna-EU07/fix/linux-file-case

fix(files): data named in another case is found on Linux, folders included
This commit is contained in:
maj00r
2026-11-16 13:32:01 +01:00
committed by GitHub
11 changed files with 287 additions and 31 deletions

View File

@@ -298,7 +298,9 @@ void image_cache::work()
m_queue.pop_front();
}
int width{0}, height{0}, components{0};
auto *pixels{stbi_load(image.path.c_str(), &width, &height, &components, 4)};
// the file as it's named on the disk, the path stays the key of the cache
auto const file{FileCased(image.path)};
auto *pixels{file.empty() ? nullptr : stbi_load(file.c_str(), &width, &height, &components, 4)};
if (pixels != nullptr && width > 0 && height > 0)
{
// scaled down by the average of the pixels which make each one, the longer side to the size of the cache