~ubuntu-branches/debian/sid/gdal/sid

« back to all changes in this revision

Viewing changes to apps/gdalflattenmask.c

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2012-05-07 15:04:42 UTC
  • mfrom: (5.5.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120507150442-2eks97loeh6rq005
Tags: 1.9.0-1
* Ready for sid, starting transition.
* All symfiles updated to latest builds.
* Added dh_numpy call in debian/rules to depend on numpy ABI.
* Policy bumped to 3.9.3, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
 
136
136
        if (bSetAlpha)
137
137
        {
138
 
            if ((GDALGetMaskFlags(hSrcBand) & GMF_PER_DATASET) == 0)
 
138
            if (nBands > 1 && (GDALGetMaskFlags(hSrcBand) & GMF_PER_DATASET) == 0)
139
139
            {
140
140
                fprintf(stderr, "When -set_alpha is specified, all source bands must "
141
141
                                "share the same mask band (PER_DATASET mask)\n");
217
217
        dfNoDataValue = GDALGetRasterNoDataValue(hSrcBand, &bHasNoData);
218
218
        if (!bHasNoData)
219
219
            dfNoDataValue = dfDstNoData;
220
 
        if (bHasNoData || bSetNoData)
 
220
        if (!bSetAlpha && (bHasNoData || bSetNoData))
221
221
            GDALSetRasterNoDataValue(hDstBand, dfNoDataValue);
222
222
 
223
223
        hColorTable = GDALGetRasterColorTable( hSrcBand );