Simplified some path writes

This commit is contained in:
emeric
2025-01-06 22:29:46 +01:00
parent 06a4db51f7
commit 10d900faf2
25 changed files with 59 additions and 65 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ namespace lms::image
{
LMS_SCOPED_TRACE_DETAILED("Image", "ReadFile");
std::ifstream ifs{ p.string(), std::ios::binary };
std::ifstream ifs{ p, std::ios::binary };
if (!ifs.is_open())
throw Exception{ "Cannot open file '" + p.string() + "' for reading purpose" };
+1 -1
View File
@@ -32,7 +32,7 @@ namespace lms::image
{
void init(const std::filesystem::path& path)
{
Magick::InitializeMagick(path.string().c_str());
Magick::InitializeMagick(path.c_str());
if (auto nbThreads{ MagickLib::GetMagickResourceLimit(MagickLib::ThreadsResource) }; nbThreads != 1)
LMS_LOG(COVER, WARNING, "Consider setting env var OMP_NUM_THREADS=1 to save resources");
@@ -54,7 +54,7 @@ namespace lms::image::GraphicsMagick
{
try
{
_image.read(p.string().c_str());
_image.read(p.c_str());
}
catch (Magick::WarningCoder& e)
{
-2
View File
@@ -73,9 +73,7 @@ namespace lms::image::STB
int n{};
_data = UniquePtrFree{ stbi_load(p.c_str(), &_width, &_height, &n, 3), std::free };
if (!_data)
{
throw StbiException{ "Cannot load image from file" };
}
}
void RawImage::resize(ImageSize width)