34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
--- qgis-1.7.0/src/plugins/georeferencer/qgsimagewarper.cpp 2011-06-05 13:59:48.000000000 +0200
|
|
+++ qgis-1.7.0-georef-crash/src/plugins/georeferencer/qgsimagewarper.cpp 2011-06-11 23:42:55.424025275 +0200
|
|
@@ -17,7 +17,6 @@
|
|
#include <cmath>
|
|
#include <iostream>
|
|
#include <cstdio>
|
|
-#include <assert.h>
|
|
|
|
#include <cpl_conv.h>
|
|
#include <cpl_string.h>
|
|
@@ -30,6 +29,7 @@
|
|
|
|
#include "qgsimagewarper.h"
|
|
#include "qgsgeoreftransform.h"
|
|
+#include "qgslogger.h"
|
|
|
|
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1800
|
|
#define TO8F(x) (x).toUtf8().constData()
|
|
@@ -195,8 +195,12 @@
|
|
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;
|