diff --git a/src/core/layout/qgslayoutexporter.cpp b/src/core/layout/qgslayoutexporter.cpp index f364465510ac..c157289042b8 100644 --- a/src/core/layout/qgslayoutexporter.cpp +++ b/src/core/layout/qgslayoutexporter.cpp @@ -1727,6 +1727,10 @@ bool QgsLayoutExporter::georeferenceOutputPrivate( const QString &file, QgsLayou if ( !mLayout ) return false; + const char *const apszAllowedDrivers[] = { "GTiff", "PDF", nullptr }; + if ( !GDALIdentifyDriverEx( file.toUtf8().constData(), GDAL_OF_RASTER, apszAllowedDrivers, nullptr ) ) + return false; + if ( !map && includeGeoreference ) map = mLayout->referenceMap();