Fixes in the algorithm that detects what type of transparency an image has. #8425
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
grdimage_transparencies()
function detects if an image has transparency as a separate layer (I->alpha) or as a 4th layer as in an RGBA image, but this function was failing in more than one case. To start with it was always failing for pixel interleaved RGBA images, and for other it was also failing depending on imagen_rows x n_cols
and it was not scanning the entire alpha layer. When it failed it fell into the variable transparency case that is quite heavy in PostScript size.I run the tests and apparently (and I say apparently because I can't make the remote and DVC files to be in sync) only the
transp_mix
test changed. But that test was already wrong because subplot (2,1) is exactly equal to (3,2) when the meant to be different. With this fix that sub-panel plot is still wrong as the transparency in figure is ignored. After many debugs I quit trying to find why it fails and also what was the original idea of that test. RGB images with a separate alpha layer also fail to set the transparency. Again, after long suffering trying to understand why, when all seem to go right, I gad to give up too. But this affects more the Julia side where that case is more common and I'm forced to save image in file and read it again (this forces a conversion to RGBA).In summary, not all problems were solved but some important ones were.