Fix build issues
This commit is contained in:
@@ -54,10 +54,19 @@ namespace OpenVulkano
|
|||||||
fwrite(&value, sizeof(value), 1, file);
|
fwrite(&value, sizeof(value), 1, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static FILE* FOpen(const T* path)
|
||||||
|
{
|
||||||
|
if constexpr (std::is_same_v<T, char>)
|
||||||
|
return fopen(path, "wb");
|
||||||
|
else
|
||||||
|
return _wfopen(path, "wb");
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
JpegWithTagsWriter(const std::filesystem::path& filePath)
|
JpegWithTagsWriter(const std::filesystem::path& filePath)
|
||||||
{
|
{
|
||||||
file = fopen(filePath.c_str(), "wb");
|
file = FOpen(filePath.c_str());
|
||||||
if (file == nullptr) throw std::runtime_error("Can't open file.");
|
if (file == nullptr) throw std::runtime_error("Can't open file.");
|
||||||
// Write soi marker
|
// Write soi marker
|
||||||
fputc(0xFF, file);
|
fputc(0xFF, file);
|
||||||
|
|||||||
@@ -97,8 +97,7 @@ namespace OpenVulkano::Image
|
|||||||
|
|
||||||
[[maybe_unused]] XmpBuilder& XmpBuilder::SetCreateDateNow()
|
[[maybe_unused]] XmpBuilder& XmpBuilder::SetCreateDateNow()
|
||||||
{
|
{
|
||||||
std::chrono::system_clock::now();
|
std::time_t currentTime = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
||||||
std::time_t currentTime = std::chrono::system_clock::to_time_t(now);
|
|
||||||
SetCreateDate(currentTime);
|
SetCreateDate(currentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user