mirror of
https://github.com/imagemagick/imagemagick
synced 2024-10-18 08:52:53 +00:00
if resampling fails, replace with invalid pixel
This commit is contained in:
parent
3be0fa779c
commit
b0f6c05f67
|
@ -2863,16 +2863,21 @@ if ( d.x == 0.5 && d.y == 0.5 ) {
|
|||
}
|
||||
else {
|
||||
/* resample the source image to find its correct color */
|
||||
(void) ResamplePixelColor(resample_filter[id],s.x,s.y,&pixel,
|
||||
status=ResamplePixelColor(resample_filter[id],s.x,s.y,&pixel,
|
||||
exception);
|
||||
/* if validity between 0.0 and 1.0 mix result with invalid pixel */
|
||||
if ( validity < 1.0 ) {
|
||||
/* Do a blend of sample color and invalid pixel */
|
||||
/* should this be a 'Blend', or an 'Over' compose */
|
||||
CompositePixelInfoBlend(&pixel,validity,&invalid,(1.0-validity),
|
||||
&pixel);
|
||||
}
|
||||
SetPixelViaPixelInfo(distort_image,&pixel,q);
|
||||
if (status == MagickFalse)
|
||||
SetPixelViaPixelInfo(distort_image,&invalid,q);
|
||||
else
|
||||
{
|
||||
/* if validity between 0.0 & 1.0 mix result with invalid pixel */
|
||||
if ( validity < 1.0 ) {
|
||||
/* Do a blend of sample color and invalid pixel */
|
||||
/* should this be a 'Blend', or an 'Over' compose */
|
||||
CompositePixelInfoBlend(&pixel,validity,&invalid,(1.0-validity),
|
||||
&pixel);
|
||||
}
|
||||
SetPixelViaPixelInfo(distort_image,&pixel,q);
|
||||
}
|
||||
}
|
||||
q+=GetPixelChannels(distort_image);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue