/*
User pressed mode button.
*/
- (void) CopyMagickString(reply_info.text,mode_info.text,
- MaxTextExtent);
+ if (mode_info.text != (char *) NULL)
+ (void) CopyMagickString(reply_info.text,mode_info.text,
+ MaxTextExtent);
(void) CopyMagickString(primary_selection,reply_info.text,
MaxTextExtent);
(void) XSetSelectionOwner(display,XA_PRIMARY,windows->widget.id,
{
pixel=XGetPixel(ximage,x,y);
color=(pixel >> red_shift) & red_mask;
- color=(65535UL*color)/red_mask;
- SetPixelRed(composite_image,
- ScaleShortToQuantum((unsigned short) color),q);
+ if (red_mask != 0)
+ color=(65535UL*color)/red_mask;
+ SetPixelRed(composite_image,ScaleShortToQuantum(
+ (unsigned short) color),q);
color=(pixel >> green_shift) & green_mask;
- color=(65535UL*color)/green_mask;
- SetPixelGreen(composite_image,
- ScaleShortToQuantum((unsigned short) color),q);
+ if (green_mask != 0)
+ color=(65535UL*color)/green_mask;
+ SetPixelGreen(composite_image,ScaleShortToQuantum(
+ (unsigned short) color),q);
color=(pixel >> blue_shift) & blue_mask;
- color=(65535UL*color)/blue_mask;
- SetPixelBlue(composite_image,
- ScaleShortToQuantum((unsigned short) color),q);
+ if (blue_mask != 0)
+ color=(65535UL*color)/blue_mask;
+ SetPixelBlue(composite_image,ScaleShortToQuantum(
+ (unsigned short) color),q);
q+=GetPixelChannels(composite_image);
}
status=SyncCacheViewAuthenticPixels(composite_view,exception);