Hand merged all fixes from branch3.0. If I missed something, please just check it in.
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user