Skip to content

Commit

Permalink
[BACKPORT] Partially address https://bugzilla.redhat.com/show_bug.cgi…
Browse files Browse the repository at this point in the history
…?id=712620 - don't assert when things go wrong. Still needs to give user some decent feedback somehow but at least it shouldnt crash QGIS
  • Loading branch information
timlinux committed Sep 24, 2011
1 parent 8c3e066 commit 0b1afb0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plugins/georeferencer/qgsimagewarper.cpp
Expand Up @@ -195,8 +195,12 @@ int QgsImageWarper::warpFile( const QString& input,
if ( destResY > 0.0 ) destResY = -destResY;

// Assert that the north-up convention is fullfiled by GDALSuggestedWarpOutput (should always be the case)
assert( adfGeoTransform[0] > 0.0 );
assert( adfGeoTransform[5] < 0.0 );
// Asserts are bad as they just crash out, changed to just return false. TS
if ( adfGeoTransform[0] <= 0.0 || adfGeoTransform[5] >= 0.0 )
{
QgsDebugMsg("Image is not north up after GDALSuggestedWarpOutput, bailing out.");
return false;
}
// Find suggested output image extent (in georeferenced units)
double minX = adfGeoTransform[0];
double maxX = adfGeoTransform[0] + adfGeoTransform[1] * destPixels;
Expand Down

0 comments on commit 0b1afb0

Please sign in to comment.