Simplified some path writes
This commit is contained in:
@@ -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" };
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user