Hand merged all fixes from branch3.0. If I missed something, please just check it in.

This commit is contained in:
Oliver Duis
2010-12-21 23:54:09 +01:00
parent f90f4fb7d5
commit 2ecc32b6f2
15 changed files with 1868 additions and 1180 deletions

View File

@@ -276,10 +276,17 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
firstgreen++;
int skip = 1;
if (ri->get_FujiWidth() != 0){
if (fixwh == 1) // fix height, scale width
skip = ((ri->get_height() - ri->get_FujiWidth()) / sqrt(0.5) - firstgreen - 1) / h;
else
skip = (ri->get_FujiWidth()/sqrt(0.5) - firstgreen - 1) / w;
}else{
if (fixwh == 1) // fix height, scale width
skip = (ri->get_height() - firstgreen - 1) / h;
else
skip = (ri->get_width() - firstgreen - 1) / w;
}
if (skip % 2)
skip--;
if (skip < 1)
@@ -362,6 +369,8 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
}
delete tmpImg;
tmpImg = fImg;
tmpw = wide;
tmph = high;
}
if (fixwh == 1) // fix height, scale width
@@ -943,10 +952,10 @@ bool Thumbnail::writeImage (const Glib::ustring& fname, int format) {
// If it's not gamma corrected (usually a JPG) we take the normal maximum
max=0;
for (int row=0; row<thumbImg->height; row++)
for (int col=0; col<thumbImg->width; col++) {
if (thumbImg->r[row][col]>max) max = thumbImg->r[row][col];
if (thumbImg->g[row][col]>max) max = thumbImg->g[row][col];
for (int row=0; row<thumbImg->height; row++)
for (int col=0; col<thumbImg->width; col++) {
if (thumbImg->r[row][col]>max) max = thumbImg->r[row][col];
if (thumbImg->g[row][col]>max) max = thumbImg->g[row][col];
if (thumbImg->b[row][col]>max) max = thumbImg->b[row][col];
}