From decdae515b4a4ff6bf125d857754775d9e64c40f Mon Sep 17 00:00:00 2001 From: edgarriba Date: Sat, 31 Oct 2015 20:11:05 +0100 Subject: [PATCH] set GA_Update flag in order remove ERROR 8: band 1: Attempt to write to read only dataset inGDALRasterBand::Fill() --- modules/imgcodecs/src/grfmt_gdal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgcodecs/src/grfmt_gdal.cpp b/modules/imgcodecs/src/grfmt_gdal.cpp index 1094b91b38..3d3bbb834e 100644 --- a/modules/imgcodecs/src/grfmt_gdal.cpp +++ b/modules/imgcodecs/src/grfmt_gdal.cpp @@ -461,7 +461,7 @@ bool GdalDecoder::readData( Mat& img ){ bool GdalDecoder::readHeader(){ // load the dataset - m_dataset = (GDALDataset*) GDALOpen( m_filename.c_str(), GA_ReadOnly); + m_dataset = (GDALDataset*) GDALOpen( m_filename.c_str(), GA_Update); // if dataset is null, then there was a problem if( m_dataset == NULL ){