--- a/src/gmt_api.c +++ b/src/gmt_api.c @@ -4632,7 +4632,11 @@ h = I->header; data = gmt_M_memory_aligned (GMT, NULL, h->size * 3, unsigned char); /* The new r,g,b image */ - if (GMT->parent->GMT->current.gdal_read_in.O.mem_layout[0] && strncmp (GMT->parent->GMT->current.gdal_read_in.O.mem_layout, "TRB", 3U) == 0) { /* Band interleave */ +#ifdef HAVE_GDAL + if (GMT->parent->GMT->current.gdal_read_in.O.mem_layout[0] && strncmp (GMT->parent->GMT->current.gdal_read_in.O.mem_layout, "TRB", 3U) == 0) { +#else + if (0) { +#endif /* Band interleave */ strncpy (h->mem_layout, "TRB ", 4); /* Fill out red, green, and blue bands */ for (c = 0; c < 3; c++) off[c] = c * h->size; for (node = 0; node < h->size; node++) { /* For all pixels, including the pad */ @@ -4650,7 +4654,9 @@ for (c = 0; c < 3; c++, k++) data[k] = I->colormap[start_c+c]; /* Place r,g,b in separate bands */ } /* If neither TRB or TRP we call for a changed layout, which may or may not have been implemented */ - GMT_Change_Layout (GMT->parent, GMT_IS_IMAGE, GMT->parent->GMT->current.gdal_read_in.O.mem_layout, 0, I, NULL, NULL); +#ifdef HAVE_GDAL + GMT_Change_Layout (GMT->parent, GMT_IS_IMAGE, GMT->parent->GMT->current.gdal_read_in.O.mem_layout, 0, I, NULL, NULL); +#endif } gmt_M_free_aligned (GMT, I->data); /* Free previous aligned image memory */ I->data = data; /* Pass the reallocated rgb TRB image back */ --- a/src/gmt_init.c +++ b/src/gmt_init.c @@ -14279,9 +14279,11 @@ GMT->current.setting.io_lonlat_toggle[GMT_IN] = GMT->current.setting.io_lonlat_toggle[GMT_OUT] = false; /* Reset these GDAL in/out stuff */ +#ifdef HAVE_GDAL gmt_M_memset (&GMT->current.gdal_read_in, 1, struct GMT_GDALREAD_IN_CTRL); gmt_M_memset (&GMT->current.gdal_read_out, 1, struct GMT_GDALREAD_OUT_CTRL); gmt_M_memset (&GMT->current.gdal_write, 1, struct GMT_GDALWRITE_CTRL); +#endif gmt_M_str_free (Ccopy); /* Good riddance */ }