diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index a78304c09..4c749e3c4 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -1,12 +1,12 @@ /* * This file is part of RawTherapee. * - * Copyright(c) 2004-2010 Gabor Horvath + * Copyright (c) 2004-2010 Gabor Horvath * * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or - *(at your option) any later version. + * (at your option) any later version. * * RawTherapee is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -223,7 +223,7 @@ rtengine::ProfileContent::ProfileContent(const Glib::ustring& fileName) d[length] = 0; fclose(f); - data.assign(d, length + 1); + data.assign(d, length); delete[] d; } @@ -236,7 +236,7 @@ rtengine::ProfileContent::ProfileContent(cmsHPROFILE hProfile) if (bytesNeeded > 0) { char* d = new char[bytesNeeded + 1]; cmsSaveProfileToMem(hProfile, d, &bytesNeeded); - data.assign(d, bytesNeeded + 1); + data.assign(d, bytesNeeded); delete[] d; } } @@ -247,7 +247,7 @@ cmsHPROFILE rtengine::ProfileContent::toProfile() const return !data.empty() - ? cmsOpenProfileFromMem(data.data(), data.size()) + ? cmsOpenProfileFromMem(data.c_str(), data.size()) : nullptr; } @@ -690,7 +690,7 @@ cmsHPROFILE rtengine::ICCStore::getXYZProfile() const cmsHPROFILE rtengine::ICCStore::getsRGBProfile() const { - return implementation->getXYZProfile(); + return implementation->getsRGBProfile(); } std::vector rtengine::ICCStore::getProfiles(ProfileType type) const @@ -1025,7 +1025,8 @@ cmsHPROFILE rtengine::ICCStore::createFromMatrix(const double matrix[3][3], bool return p; } -cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManagementParams &icm, GammaValues &ga) { +cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManagementParams &icm, GammaValues &ga) +{ float p[6]; //primaries ga[6] = 0.0; @@ -1121,7 +1122,8 @@ cmsHPROFILE rtengine::ICCStore::createGammaProfile(const procparams::ColorManage } // WARNING: the caller must lock lcmsMutex -cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams::ColorManagementParams &icm, GammaValues &ga) { +cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams::ColorManagementParams &icm, GammaValues &ga) +{ bool pro = false; Glib::ustring outProfile; cmsHPROFILE outputProfile = nullptr; diff --git a/rtengine/iccstore.h b/rtengine/iccstore.h index 9562f3144..d0c5ef400 100644 --- a/rtengine/iccstore.h +++ b/rtengine/iccstore.h @@ -1,12 +1,12 @@ /* * This file is part of RawTherapee. * - * Copyright(c) 2004-2010 Gabor Horvath + * Copyright (c) 2004-2010 Gabor Horvath * * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or - *(at your option) any later version. + * (at your option) any later version. * * RawTherapee is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index c7a05ab1a..ec0b31b3f 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1222,7 +1222,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p if (!useLCMS) { // use corrected sRGB profile in order to apply a good TRC if present, otherwise use LCMS2 profile generated by lab2rgb16 w/ gamma ProfileContent pc(jprof); - readyImg->setOutputProfile(pc.getData().data(), pc.getData().size()); + readyImg->setOutputProfile(pc.getData().c_str(), pc.getData().size()); } } else { // use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma @@ -1242,7 +1242,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p } ProfileContent pc = ICCStore::getInstance()->getContent (params.icm.output); - readyImg->setOutputProfile(pc.getData().data(), pc.getData().size()); + readyImg->setOutputProfile(pc.getData().c_str(), pc.getData().size()); } } else { // No ICM