Skip to content

Commit

Permalink
Do not try to project images that don't have set 'need_to_project'. (#…
Browse files Browse the repository at this point in the history
…8255)

Fixes #8254
  • Loading branch information
joa-quim committed Jan 2, 2024
1 parent dd649c3 commit 24ae8e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/grdimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ tr_image: GMT_Report (API, GMT_MSG_INFORMATION, "Project the input image\n");
gmt_set_grddim (GMT, Img_proj->header); /* Recalculate projected image dimensions */
if (GMT_Create_Data (API, GMT_IS_IMAGE, GMT_IS_SURFACE, GMT_DATA_ONLY, NULL, NULL, NULL, 0, 0, Img_proj) == NULL)
Return (API->error); /* Failed to allocate memory for the projected image */
if (gmt_img_project (GMT, I, Img_proj, false)) Return (GMT_RUNTIME_ERROR); /* Now project the image onto the projected rectangle */
if (need_to_project && gmt_img_project (GMT, I, Img_proj, false)) Return (GMT_RUNTIME_ERROR); /* Now project the image onto the projected rectangle */
if (!API->external && (GMT_Destroy_Data (API, &I) != GMT_NOERROR)) { /* Free the original image now we have projected. Use Img_proj from now on */
Return (API->error); /* Failed to free the image */
}
Expand Down

0 comments on commit 24ae8e7

Please sign in to comment.