File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1818
1919#include < algorithm>
2020#include < array>
21+ #include < fstream>
2122#include < iostream>
2223
2324namespace Exiv2 {
@@ -218,13 +219,12 @@ void Jp2Image::readMetadata() {
218219 std::copy_n (data.c_data (pad), icc.size (), icc.begin ());
219220#ifdef EXIV2_DEBUG_MESSAGES
220221 const char * iccPath = " /tmp/libexiv2_jp2.icc" ;
221- FILE* f = fopen (iccPath, " wb" );
222- if (f) {
223- fwrite (icc.c_data (), icc.size (), 1 , f);
224- fclose (f);
222+ if (auto f = std::ofstream (iccPath, std::ios::binary)) {
223+ f.write (reinterpret_cast <const char *>(icc.c_data ()), static_cast <std::streamsize>(icc.size ()));
224+ f.close ();
225+ std::cout << " Exiv2::Jp2Image::readMetadata: wrote iccProfile " << icc.size () << " bytes to " << iccPath
226+ << ' \n ' ;
225227 }
226- std::cout << " Exiv2::Jp2Image::readMetadata: wrote iccProfile " << icc.size () << " bytes to " << iccPath
227- << ' \n ' ;
228228#endif
229229 setIccProfile (std::move (icc));
230230 }
You can’t perform that action at this time.
0 commit comments