Fixed occasional crash if resizing images while thumbs still loading; see issue #579
This commit is contained in:
@@ -767,6 +767,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Thumbnail::getImageWidth (const procparams::ProcParams& params, int rheight) {
|
int Thumbnail::getImageWidth (const procparams::ProcParams& params, int rheight) {
|
||||||
|
if (thumbImg==NULL) return 0; // Can happen if thumb is just building and GUI comes in with resize wishes
|
||||||
|
|
||||||
int rwidth;
|
int rwidth;
|
||||||
if (params.coarse.rotate==90 || params.coarse.rotate==270)
|
if (params.coarse.rotate==90 || params.coarse.rotate==270)
|
||||||
@@ -878,6 +879,7 @@ void Thumbnail::getSpotWB (const procparams::ProcParams& params, int xp, int yp,
|
|||||||
rtemp = ct.getTemp ();
|
rtemp = ct.getTemp ();
|
||||||
rgreen = ct.getGreen ();
|
rgreen = ct.getGreen ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Thumbnail::transformPixel (int x, int y, int tran, int& tx, int& ty) {
|
void Thumbnail::transformPixel (int x, int y, int tran, int& tx, int& ty) {
|
||||||
|
|
||||||
int W = thumbImg->width;
|
int W = thumbImg->width;
|
||||||
|
@@ -272,11 +272,9 @@ void Thumbnail::decreaseRef ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Thumbnail::getThumbnailSize (int &w, int &h) {
|
void Thumbnail::getThumbnailSize (int &w, int &h) {
|
||||||
|
w=0;
|
||||||
if (tpp)
|
if (tpp) w = tpp->getImageWidth (getProcParams(), h); // this might return 0 if image was just building
|
||||||
w = tpp->getImageWidth (getProcParams(), h);
|
if (w==0) w = tw * h / th;
|
||||||
else
|
|
||||||
w = tw * h / th;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rtengine::IImage8* Thumbnail::processThumbImage (const rtengine::procparams::ProcParams& pparams, int h, double& scale) {
|
rtengine::IImage8* Thumbnail::processThumbImage (const rtengine::procparams::ProcParams& pparams, int h, double& scale) {
|
||||||
|
Reference in New Issue
Block a user