Auto distortion fix for portrait orientation on behalf of Guokai; see issue #582
This commit is contained in:
@@ -692,11 +692,11 @@ double ImProcFunctions::getAutoDistor (const Glib::ustring &fname, int thumb_si
|
||||
int w_raw=-1, h_raw=thumb_size;
|
||||
int w_thumb=-1, h_thumb=thumb_size;
|
||||
|
||||
Thumbnail* thumb = rtengine::Thumbnail::loadQuickFromRaw (fname, ri, w_thumb, h_thumb, 1);
|
||||
Thumbnail* thumb = rtengine::Thumbnail::loadQuickFromRaw (fname, ri, w_thumb, h_thumb, 1, FALSE);
|
||||
if (thumb == NULL)
|
||||
return 0.0;
|
||||
|
||||
Thumbnail* raw = rtengine::Thumbnail::loadFromRaw (fname, ri, w_raw, h_raw, 1);
|
||||
Thumbnail* raw = rtengine::Thumbnail::loadFromRaw (fname, ri, w_raw, h_raw, 1, FALSE);
|
||||
if (raw == NULL) {
|
||||
delete thumb;
|
||||
return 0.0;
|
||||
|
@@ -131,7 +131,7 @@ Thumbnail* Thumbnail::loadFromImage (const Glib::ustring& fname, int &w, int &h,
|
||||
return tpp;
|
||||
}
|
||||
|
||||
Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh)
|
||||
Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh, bool rotate)
|
||||
{
|
||||
RawImage *ri= new RawImage(fname);
|
||||
int r = ri->loadRaw(false,false);
|
||||
@@ -210,7 +210,7 @@ Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataL
|
||||
tpp->autowbTemp=2700;
|
||||
tpp->autowbGreen=1.0;
|
||||
|
||||
if (ri->get_rotateDegree() > 0) {
|
||||
if (rotate && ri->get_rotateDegree() > 0) {
|
||||
Image16* rot = tpp->thumbImg->rotate(ri->get_rotateDegree());
|
||||
delete tpp->thumbImg;
|
||||
tpp->thumbImg = rot;
|
||||
@@ -229,7 +229,7 @@ Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataL
|
||||
#define FISBLUE(filter,row,col) \
|
||||
((filter >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3)==2 || !filter)
|
||||
|
||||
Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh)
|
||||
Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh, bool rotate)
|
||||
{
|
||||
RawImage *ri= new RawImage (fname);
|
||||
int r = ri->loadRaw();
|
||||
@@ -465,7 +465,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati
|
||||
|
||||
ColorTemp::mul2temp(rm, gm, bm, tpp->autowbTemp, tpp->autowbGreen);
|
||||
|
||||
if (ri->get_rotateDegree() > 0) {
|
||||
if (rotate && ri->get_rotateDegree() > 0) {
|
||||
Image16* rot = tpp->thumbImg->rotate(ri->get_rotateDegree());
|
||||
delete tpp->thumbImg;
|
||||
tpp->thumbImg = rot;
|
||||
|
@@ -75,8 +75,8 @@ namespace rtengine {
|
||||
int getImageWidth (const procparams::ProcParams& pparams, int rheight);
|
||||
void getFinalSize (const rtengine::procparams::ProcParams& pparams, int& w, int& h);
|
||||
|
||||
static Thumbnail* loadQuickFromRaw (const Glib::ustring& fname, rtengine::RawMetaDataLocation& rml, int &w, int &h, int fixwh);
|
||||
static Thumbnail* loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh);
|
||||
static Thumbnail* loadQuickFromRaw (const Glib::ustring& fname, rtengine::RawMetaDataLocation& rml, int &w, int &h, int fixwh, bool rotate);
|
||||
static Thumbnail* loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh, bool rotate);
|
||||
static Thumbnail* loadFromImage (const Glib::ustring& fname, int &w, int &h, int fixwh);
|
||||
|
||||
void getCamWB (double& temp, double& green);
|
||||
|
@@ -110,12 +110,12 @@ void Thumbnail::_generateThumbnailImage () {
|
||||
if ( initial_ && options.internalThumbIfUntouched)
|
||||
{
|
||||
quick = true;
|
||||
tpp = rtengine::Thumbnail::loadQuickFromRaw (fname, ri, tw, th, 1);
|
||||
tpp = rtengine::Thumbnail::loadQuickFromRaw (fname, ri, tw, th, 1, TRUE);
|
||||
}
|
||||
if ( tpp == 0 )
|
||||
{
|
||||
quick = false;
|
||||
tpp = rtengine::Thumbnail::loadFromRaw (fname, ri, tw, th, 1);
|
||||
tpp = rtengine::Thumbnail::loadFromRaw (fname, ri, tw, th, 1, TRUE);
|
||||
}
|
||||
if (tpp) {
|
||||
cfs.format = FT_Raw;
|
||||
|
Reference in New Issue
Block a user