}
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- "Profile: ICC, %lu bytes",(unsigned long) length);
+ "Profile: ICC, %.20g bytes",(double) length);
return(MagickTrue);
}
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
p=GetStringInfoDatum(profile);
- for (i=(ssize_t) GetStringInfoLength(profile)-1; i >= 0; i--)
+ for (i=0; i < (ssize_t) GetStringInfoLength(profile); i++)
*p++=(unsigned char) GetCharacter(jpeg_info);
iptc_profile=(StringInfo *) GetImageProfile(image,"8bim");
if (iptc_profile != (StringInfo *) NULL)
}
else
{
- status=SetImageProfile(image,"8bim",profile);
+ if (strcmp((char *) GetStringInfoDatum(profile),"8BIM") != 0)
+ status=SetImageProfile(image,"iptc",profile);
+ else
+ status=SetImageProfile(image,"8BIM",profile);
profile=DestroyStringInfo(profile);
if (status == MagickFalse)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
}
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- "Profile: iptc, %lu bytes",(unsigned long) length);
+ "Profile: iptc, %.20g bytes",(double) length);
return(MagickTrue);
}
image->filename);
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- "Profile: %s, %lu bytes",name,(unsigned long) length);
+ "Profile: %s, %.20g bytes",name,(double) length);
return(MagickTrue);
}
if (number_bytes <= 0)
return;
source=(SourceManager *) cinfo->src;
- while (number_bytes > (ssize_t) source->manager.bytes_in_buffer)
+ while (number_bytes > (long) source->manager.bytes_in_buffer)
{
number_bytes-=(long) source->manager.bytes_in_buffer;
(void) FillInputBuffer(cinfo);
}
- source->manager.next_input_byte+=(size_t) number_bytes;
- source->manager.bytes_in_buffer-=(size_t) number_bytes;
+ source->manager.next_input_byte+=number_bytes;
+ source->manager.bytes_in_buffer-=number_bytes;
}
static void TerminateSource(j_decompress_ptr cinfo)
image->quality=(size_t) i+1;
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- "Quality: %ld (%s)",(long) i+1,(qvalue <= hash[i]) &&
+ "Quality: %.20g (%s)",(double) i+1,(qvalue <= hash[i]) &&
(sum <= sums[i]) ? "exact" : "approximate");
break;
}
image->quality=(size_t) i+1;
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- "Quality: %ld (%s)",(long) i+1,(qvalue <= hash[i]) &&
+ "Quality: %.20g (%s)",(double) i+1,(qvalue <= hash[i]) &&
(sum <= sums[i]) ? "exact" : "approximate");
break;
}
for (i=1; i < 16; i++)
if ((i != 2) && (i != 13) && (i != 14))
jpeg_set_marker_processor(&jpeg_info,(int) (JPEG_APP0+i),ReadProfile);
- i=jpeg_read_header(&jpeg_info,MagickTrue);
+ i=(ssize_t) jpeg_read_header(&jpeg_info,MagickTrue);
if ((image_info->colorspace == YCbCrColorspace) ||
(image_info->colorspace == Rec601YCbCrColorspace) ||
(image_info->colorspace == Rec709YCbCrColorspace))
jpeg_info.scale_denom=(unsigned int) scale_factor;
jpeg_calc_output_dimensions(&jpeg_info);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Scale factor: %ld",
- (long) scale_factor);
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+ "Scale factor: %.20g",(double) scale_factor);
}
precision=(size_t) jpeg_info.data_precision;
#if (JPEG_LIB_VERSION >= 61) && defined(D_PROGRESSIVE_SUPPORTED)
}
JPEGSetImageQuality(&jpeg_info,image);
JPEGSetImageSamplingFactor(&jpeg_info,image);
- (void) FormatMagickString(value,MaxTextExtent,"%ld",(long)
+ (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
jpeg_info.out_color_space);
(void) SetImageProperty(image,"jpeg:colorspace",value);
if (image_info->ping != MagickFalse)
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
- if (SetImageProgress(image,LoadImageTag,y,image->rows) == MagickFalse)
+ if (SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,image->rows) == MagickFalse)
break;
}
/*
ResetImageProfileIterator(image);
for (name=GetNextImageProfile(image); name != (const char *) NULL; )
{
+ register unsigned char
+ *p;
+
profile=GetImageProfile(image,name);
+ p=GetStringInfoDatum(custom_profile);
if (LocaleCompare(name,"EXIF") == 0)
for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65533L)
{
for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65519L)
{
length=MagickMin(GetStringInfoLength(profile)-i,65519L);
- p=GetStringInfoDatum(custom_profile);
p[12]=(unsigned char) ((i/65519L)+1);
p[13]=(unsigned char) (GetStringInfoLength(profile)/65519L+1);
(void) CopyMagickMemory(p+tag_length,GetStringInfoDatum(profile)+i,
if (((LocaleCompare(name,"IPTC") == 0) ||
(LocaleCompare(name,"8BIM") == 0)) && (iptc == MagickFalse))
{
- register unsigned char
- *p;
-
size_t
roundup;
iptc=MagickTrue;
- p=GetStringInfoDatum(custom_profile);
- if (LocaleNCompare((char *) GetStringInfoDatum(profile),"8BIM",4) == 0)
- {
- (void) CopyMagickMemory(p,"Photoshop 3.0\0",14);
- tag_length=14;
- }
- else
- {
- (void) CopyMagickMemory(p,"Photoshop 3.0\08BIM\04\04\0\0\0\0",24);
- p[13]=0x00;
- p[24]=(unsigned char) (GetStringInfoLength(profile) >> 8);
- p[25]=(unsigned char) (GetStringInfoLength(profile) & 0xff);
- tag_length=26;
- }
for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65500L)
{
length=MagickMin(GetStringInfoLength(profile)-i,65500L);
roundup=(size_t) (length & 0x01);
- (void) CopyMagickMemory(p+tag_length,GetStringInfoDatum(profile)+i,
- length);
+ if (LocaleNCompare((char *) GetStringInfoDatum(profile),"8BIM",4) == 0)
+ {
+ (void) memcpy(p,"Photoshop 3.0 ",14);
+ tag_length=14;
+ }
+ else
+ {
+ (void) CopyMagickMemory(p,"Photoshop 3.0 8BIM\04\04\0\0\0\0",24);
+ tag_length=26;
+ p[24]=(unsigned char) (length >> 8);
+ p[25]=(unsigned char) (length & 0xff);
+ }
+ p[13]=0x00;
+ (void) memcpy(p+tag_length,GetStringInfoDatum(profile)+i,length);
if (roundup != 0)
p[length+tag_length]='\0';
jpeg_write_marker(jpeg_info,IPTC_MARKER,GetStringInfoDatum(
}
xmp_profile=DestroyStringInfo(xmp_profile);
}
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),"%s profile: %lu bytes",
- name,(unsigned long) GetStringInfoLength(profile));
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+ "%s profile: %.20g bytes",name,(double) GetStringInfoLength(profile));
name=GetNextImageProfile(image);
}
custom_profile=DestroyStringInfo(custom_profile);
jpeg_info.density_unit=(UINT8) 1;
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- "Image resolution: %ld,%ld",(long) floor(image->x_resolution+0.5),
- (long) floor(image->y_resolution+0.5));
+ "Image resolution: %.20g,%.20g",floor(image->x_resolution+0.5),
+ floor(image->y_resolution+0.5));
if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
{
/*
else
jpeg_set_quality(&jpeg_info,(int) image->quality,MagickTrue);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Quality: %lu",
- (unsigned long) image->quality);
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Quality: %.20g",
+ (double) image->quality);
}
else
{
else
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"Storage class: DirectClass");
- (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Depth: %lu",
- (unsigned long) image->depth);
+ (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Depth: %.20g",
+ (double) image->depth);
if (image->colors != 0)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- "Number of colors: %lu",(unsigned long) image->colors);
+ "Number of colors: %.20g",(double) image->colors);
else
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"Number of colors: unspecified");