Skip to content

Commit 24ae8e7

Browse files
authored
Do not try to project images that don't have set 'need_to_project'. (#8255)
Fixes #8254
1 parent dd649c3 commit 24ae8e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/grdimage.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ tr_image: GMT_Report (API, GMT_MSG_INFORMATION, "Project the input image\n");
19701970
gmt_set_grddim (GMT, Img_proj->header); /* Recalculate projected image dimensions */
19711971
if (GMT_Create_Data (API, GMT_IS_IMAGE, GMT_IS_SURFACE, GMT_DATA_ONLY, NULL, NULL, NULL, 0, 0, Img_proj) == NULL)
19721972
Return (API->error); /* Failed to allocate memory for the projected image */
1973-
if (gmt_img_project (GMT, I, Img_proj, false)) Return (GMT_RUNTIME_ERROR); /* Now project the image onto the projected rectangle */
1973+
if (need_to_project && gmt_img_project (GMT, I, Img_proj, false)) Return (GMT_RUNTIME_ERROR); /* Now project the image onto the projected rectangle */
19741974
if (!API->external && (GMT_Destroy_Data (API, &I) != GMT_NOERROR)) { /* Free the original image now we have projected. Use Img_proj from now on */
19751975
Return (API->error); /* Failed to free the image */
19761976
}

0 commit comments

Comments
 (0)