(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Enter BUILD_PALETTE:");
- if (image->colormap != NULL)
+ if (logging != MagickFalse && image->colormap != NULL)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" i (red,green,blue,opacity)");
* to see if any were lost. If not, we also
* set the image to PaletteMatteType. Otherwise
* we return without changing it. In any case
- * we destroy the clone. This workaround is no
- * doubt costly.
+ * we destroy the clone.
*/
ExceptionInfo
}
}
- if (image->colormap != NULL)
+ if (logging != MagickFalse && image->colormap != NULL)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" i (red,green,blue,opacity)");
}
if (logging != MagickFalse)
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " Setting up bKGD chunk (1)");
- if (logging != MagickFalse)
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " ping_bit_depth=%d",ping_bit_depth);
+ {
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+ " Setting up bKGD chunk (1)");
+
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+ " ping_bit_depth=%d",ping_bit_depth);
+ }
ping_have_bKGD = MagickTrue;
"image has 0 colors", "`%s'","");
}
- if (logging != MagickFalse)
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " SyncImage.2.");
+ if (logging != MagickFalse)
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+ " SyncImage.2.");
while ((int) (one << ping_bit_depth) < (ssize_t) image_colors)
ping_bit_depth <<= 1;
{
png_set_PLTE(ping,ping_info,NULL,0);
- if (logging)
+ if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Setting up empty PLTE chunk");
}
palette[i].blue=ScaleQuantumToChar(image->colormap[i].blue);
}
- if (logging)
+ if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Setting up PLTE chunk with %d colors",
(int) number_colors);
mng_info->IsPalette=MagickFalse;
(void) SyncImage(image);
- if (logging)
+ if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent, GetMagickModule(),
" Cannot write image as indexed PNG, writing RGBA.");
if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Setting up bKGD chunk (2)");
+
ping_have_bKGD = MagickTrue;
ping_trans_color.gray=(png_uint_16) (QuantumScale*(maxval*
}
}
- if (logging)
+ if (logging != MagickFalse)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Setting up bKGD chunk with index=%d",(int) i);
if (i < (ssize_t) number_colors)
{
ping_have_bKGD = MagickTrue;
- if (logging)
+
+ if (logging != MagickFalse)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" background =(%d,%d,%d)",
else
{
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " No room in PLTE to add bKGD color");
+ if (logging != MagickFalse)
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+ " No room in PLTE to add bKGD color");
ping_have_bKGD = MagickFalse;
}
}
if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Setting up gAMA chunk");
+
png_set_gAMA(ping,ping_info,image->gamma);
}
if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Setting up cHRM chunk");
+
png_set_cHRM(ping,ping_info,wp.x,wp.y,rp.x,rp.y,gp.x,gp.y,
bp.x,bp.y);
}
{
png_set_PLTE(ping,ping_info,palette,(int) number_colors);
- if (logging)
+ if (logging != MagickFalse)
{
for (i=0; i< (ssize_t) number_colors; i++)
{
if (ping_have_tRNS != MagickFalse && ping_color_type < 4)
{
- if (logging)
+ if (logging != MagickFalse)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Calling png_set_tRNS with num_trans=%d",ping_num_trans);
0,
&ping_trans_color);
- if (logging)
+ if (logging != MagickFalse)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" background =(%d,%d,%d)",
default:
break;
}
- if (logging)
+
+ if (logging != MagickFalse)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing PNG image data");
for (y=0; y < (ssize_t) image->rows; y++)
{
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " Writing row of pixels (0)");
+ if (logging != MagickFalse)
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+ " Writing row of pixels (0)");
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
*(png_pixels+i)=(unsigned char) ((*(png_pixels+i) > 127) ?
255 : 0);
- if (logging && y == 0)
+ if (logging != MagickFalse && y == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing row of pixels (1)");
(void) ExportQuantumPixels(image,(const CacheView *) NULL,
quantum_info,RedQuantum,png_pixels,&image->exception);
- if (logging && y == 0)
+ if (logging != MagickFalse && y == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing GRAY PNG pixels (2)");
}
else /* PNG_COLOR_TYPE_GRAY_ALPHA */
{
- if (logging && y == 0)
+ if (logging != MagickFalse && y == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing GRAY_ALPHA PNG pixels (2)");
(void) ExportQuantumPixels(image,(const CacheView *) NULL,
quantum_info,GrayAlphaQuantum,png_pixels,&image->exception);
}
- if (logging && y == 0)
+
+ if (logging != MagickFalse && y == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing row of pixels (2)");
(void) ExportQuantumPixels(image,(const CacheView *) NULL,
quantum_info,GrayAlphaQuantum,png_pixels,&image->exception);
- if (logging && y == 0)
+ if (logging != MagickFalse && y == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing GRAY_ALPHA PNG pixels (3)");
}
(void) ExportQuantumPixels(image,(const CacheView *) NULL,
quantum_info,RGBQuantum,png_pixels,&image->exception);
- if (logging && y == 0)
+ if (logging != MagickFalse && y == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing row of pixels (3)");
if ((ping_color_type != PNG_COLOR_TYPE_GRAY) &&
(ping_color_type != PNG_COLOR_TYPE_GRAY_ALPHA))
{
- if (logging)
+ if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" pass %d, Image Is not GRAY or GRAY_ALPHA",pass);
}
for (y=0; y < (ssize_t) image->rows; y++)
{
- if (logging && y == 0)
+ if (logging != MagickFalse && y == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" pass %d, Image Is RGB, 16-bit GRAY, or GRAY_ALPHA",pass);
else if (ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
{
- if (logging && y == 0)
+ if (logging != MagickFalse && y == 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing GRAY_ALPHA PNG pixels (4)");
(void) ExportQuantumPixels(image,(const CacheView *) NULL,
quantum_info,IndexQuantum,png_pixels,&image->exception);
- if (logging && y <= 2)
+ if (logging != MagickFalse && y <= 2)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Writing row of pixels (4)");