Merge branch 'dev' into metadata-exiv2

- Rating (#5325) not yet implemented
This commit is contained in:
Flössie
2019-09-24 14:30:54 +02:00
539 changed files with 7707 additions and 5098 deletions

View File

@@ -14,7 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "rtengine.h"
#include "rtthumbnail.h"
@@ -522,6 +522,17 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, eSensorType &sens
return nullptr;
}
if (ri->getFrameCount() == 7) {
// special case for Hasselblad H6D-100cMS pixelshift files
// first frame is not bayer, load second frame
int r = ri->loadRaw (1, 1, 0);
if ( r ) {
delete ri;
sensorType = ST_NONE;
return nullptr;
}
}
sensorType = ri->getSensorType();
int width = ri->get_width();
@@ -1130,6 +1141,10 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
Imagefloat* baseImg = resizeTo<Imagefloat> (rwidth, rheight, interp, thumbImg);
if (isRaw && params.filmNegative.enabled) {
processFilmNegative(params, baseImg, rwidth, rheight, rmi, gmi, bmi);
}
if (params.coarse.rotate) {
baseImg->rotate (params.coarse.rotate);
rwidth = baseImg->getWidth();
@@ -1439,19 +1454,22 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
}
myscale = 1.0 / myscale;
/* // apply crop
if (params.crop.enabled) {
int ix = 0;
for (int i=0; i<fh; i++)
for (int j=0; j<fw; j++)
if (i<params.crop.y/myscale || i>(params.crop.y+params.crop.h)/myscale || j<params.crop.x/myscale || j>(params.crop.x+params.crop.w)/myscale) {
readyImg->data[ix++] /= 3;
readyImg->data[ix++] /= 3;
readyImg->data[ix++] /= 3;
}
else
ix += 3;
}*/
// apply crop
if (params.crop.enabled) {
int ix = 0;
for (int i = 0; i < fh; ++i) {
for (int j = 0; j < fw; ++j) {
if (i < params.crop.y * myscale || i > (params.crop.y + params.crop.h) * myscale || j < params.crop.x * myscale || j > (params.crop.x + params.crop.w) * myscale) {
readyImg->data[ix++] /= 3;
readyImg->data[ix++] /= 3;
readyImg->data[ix++] /= 3;
} else {
ix += 3;
}
}
}
}
return readyImg;
}