Improve clip path for images in -Qi#6523
Conversation
THe algorithm used for building the staircase clip path for the image in grdview -Qi was somewhat smart but not smart enough, leaving a path when there is no valid image to the far left or right. WHile clipping is fine, the fact that the path extends too far means ghostscript senses these and the bounding box is too large. This PR eliminates that problem. I also added more comments to explain the otherwise cryptic section. THe plot below show an actual 3-D image clip path. The heavy line was the previous version and the new version is the thin yellow line. No tests were affected.
|
There are a few failures that need updating. Do you want to try out the process? The steps are below.
From the base of the repository, run:
|
|
I am not sure what those failures are. I did dvc pull and status to make sure, then ran all tests. I only have the usual gspline_5 an testsuite. Are you seeing anything else in any grdview scripts? |
Weird. I just redid all the steps and still get these failures: |
|
Those vertical thin lines? That ought to be the improvements - i,e. those lines were there before but now are gone in the the new files? |
|
Just making sure you git pulled after I first published the branch since I updated it (before making a PR though). That version did leave some vertical lines at the end but the current version do not. |
Yes, I just checked again with a git pull and reran the tests. Is your branch also up-to-date based on |
|
|
Looks like the CI tests are successful (or are they only partial?) |
|
The CI tests are partial. I'm running the tests now on my linux machine to see what happens (but it's slow). |
maxrjones
left a comment
There was a problem hiding this comment.
Tests pass on Linux locally for me. Let's see what the CI tests say about the macOS confusion.
|
SO should I merge? Or are we waiting for something else? |
Yes, you can merge. The full tests only run on PRs that are merged or that uncommented gmt/.github/workflows/tests.yml Line 7 in f7f3a46 |




The algorithm used for building the staircase clip path for the image in grdview -Qi was somewhat smart but not smart enough, leaving a path when there is no valid image to the far left or right. While the clipping worked fine, the fact that the path extends too far means ghostscript senses these excursions and hence the bounding box is too large.
This PR eliminates that problem. I also added more comments to explain the otherwise cryptic section. The plot below show an actual 3-D image clip path. The BB of the full projected image is 0/8.37/0/3. The heavy line was the previous version and the new version is the thin red line.
No tests were affected.