Skip to content

Conversation

@Chuan1937
Copy link
Contributor

Add a GMT_IS_IMAGE branch to the gmtinit_get_region_from_data() function, read the image header information using the correct image type and GMT_CONTAINER_ONLY mode, extract the boundary coordinates, and then release the data structure.

Fixes #8878

@Chuan1937
Copy link
Contributor Author

Chuan1937 commented Jan 28, 2026

@joa-quim
I add a new case for this problem, and add a test for it.
I don't know if it can solve this problem in julia.

@joa-quim
Copy link
Member

@Chuan1937 Thanks a lot for looking into this. However, I don't think it solves it.

Adding a GMT_IS_IMAGE branch doesn't help because in gmtinit_set_missing_R_from_grid() the call to gmtinit_get_region_from_data is always done with GMT_IS_GRID

if ((err = gmtinit_get_region_from_data (API, GMT_IS_GRID, exact, options, wesn, &API->GMT->common.R.aspect)))

and in fact this doesn't seem to be a problem because at the end the code flow ends up in the function that read an image. I have debugged this a bit further but still think there is something fundamentally broken in gmtinit_set_missing_R_from_grid. I think I can now force it to follow a path that should work but can't still base it in a robust logic.

And your test script. Yes, I guess it will work but it is not testing this case. Reading a file works fine, but reading one that is already loaded in memory (and you would need GMT.jl to test this) is where this keep failing.

@Chuan1937 Chuan1937 marked this pull request as draft January 29, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

subplot with two pre-loaded images in Julia fails due to failure in region detection of second image.

2 participants