384
*TracePSClippath(const unsigned char *,size_t,const size_t,
386
*TraceSVGClippath(const unsigned char *,size_t,const size_t,
384
*TracePSClippath(const unsigned char *,size_t,const unsigned long,
385
const unsigned long),
386
*TraceSVGClippath(const unsigned char *,size_t,const unsigned long,
387
const unsigned long);
389
389
static MagickBooleanType GetIPTCProperty(const Image *image,const char *key)
416
416
return(MagickFalse);
417
417
attribute=(char *) NULL;
418
for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=(ssize_t) length)
418
for (i=0; i < (long) GetStringInfoLength(profile); i+=(long) length)
421
if ((ssize_t) GetStringInfoDatum(profile)[i] != 0x1c)
421
if ((long) GetStringInfoDatum(profile)[i] != 0x1c)
423
423
length=(size_t) (GetStringInfoDatum(profile)[i+3] << 8);
424
424
length|=GetStringInfoDatum(profile)[i+4];
593
593
if (ReadPropertyByte(&info,&length) != (unsigned char) 'M')
595
id=(ssize_t) ReadPropertyMSBShort(&info,&length);
596
if (id < (ssize_t) start)
595
id=(long) ReadPropertyMSBShort(&info,&length);
598
if (id > (ssize_t) stop)
600
600
if (resource != (char *) NULL)
601
601
resource=DestroyString(resource);
608
608
sizeof(*resource));
609
609
if (resource != (char *) NULL)
611
for (i=0; i < (ssize_t) count; i++)
611
for (i=0; i < (long) count; i++)
612
612
resource[i]=(char) ReadPropertyByte(&info,&length);
613
613
resource[count]='\0';
691
691
return((unsigned short) (value & 0xffff));
694
static inline size_t ReadPropertyLong(const EndianType endian,
694
static inline unsigned long ReadPropertyLong(const EndianType endian,
695
695
const unsigned char *buffer)
700
700
if (endian == MSBEndian)
702
value=(size_t) ((buffer[0] << 24) | (buffer[1] << 16) |
702
value=(unsigned long) ((buffer[0] << 24) | (buffer[1] << 16) |
703
703
(buffer[2] << 8) | buffer[3]);
704
return((size_t) (value & 0xffffffff));
704
return((unsigned long) (value & 0xffffffff));
706
value=(size_t) ((buffer[3] << 24) | (buffer[2] << 16) |
706
value=(unsigned long) ((buffer[3] << 24) | (buffer[2] << 16) |
707
707
(buffer[1] << 8 ) | (buffer[0]));
708
return((size_t) (value & 0xffffffff));
708
return((unsigned long) (value & 0xffffffff));
711
711
static MagickBooleanType GetEXIFProperty(const Image *image,
1109
1109
tag_bytes[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8};
1113
1113
number_entries,
1282
1282
q=(unsigned char *) (directory+2+(12*entry));
1283
tag_value=(ssize_t) (ReadPropertyShort(endian,q)+tag_offset);
1284
format=(size_t) ReadPropertyShort(endian,q+2);
1283
tag_value=(long) ReadPropertyShort(endian,q)+tag_offset;
1284
format=(unsigned long) ReadPropertyShort(endian,q+2);
1285
1285
if (format >= (sizeof(tag_bytes)/sizeof(*tag_bytes)))
1287
components=(ssize_t) ReadPropertyLong(endian,q+4);
1287
components=(long) ReadPropertyLong(endian,q+4);
1288
1288
number_bytes=(size_t) components*tag_bytes[format];
1289
1289
if (number_bytes <= 4)
1312
1312
case EXIF_FMT_BYTE:
1313
1313
case EXIF_FMT_UNDEFINED:
1315
EXIFMultipleValues(1,"%.20g",(double)
1315
EXIFMultipleValues(1,"%lu",(unsigned long)
1316
1316
(*(unsigned char *) p1));
1319
1319
case EXIF_FMT_SBYTE:
1321
EXIFMultipleValues(1,"%.20g",(double) (*(signed char *) p1));
1321
EXIFMultipleValues(1,"%ld",(long) (*(signed char *) p1));
1324
1324
case EXIF_FMT_SSHORT:
1334
1334
case EXIF_FMT_ULONG:
1336
EXIFMultipleValues(4,"%.20g",(double)
1337
ReadPropertyLong(endian,p1));
1336
EXIFMultipleValues(4,"%lu",ReadPropertyLong(endian,p1));
1340
1339
case EXIF_FMT_SLONG:
1342
EXIFMultipleValues(4,"%.20g",(double)
1343
ReadPropertyLong(endian,p1));
1341
EXIFMultipleValues(4,"%ld",ReadPropertyLong(endian,p1));
1346
1344
case EXIF_FMT_URATIONAL:
1348
EXIFMultipleFractions(8,"%.20g/%.20g",(double)
1349
ReadPropertyLong(endian,p1),(double)
1346
EXIFMultipleFractions(8,"%ld/%ld",ReadPropertyLong(endian,p1),
1350
1347
ReadPropertyLong(endian,p1+4));
1353
1350
case EXIF_FMT_SRATIONAL:
1355
EXIFMultipleFractions(8,"%.20g/%.20g",(double)
1356
ReadPropertyLong(endian,p1),(double)
1352
EXIFMultipleFractions(8,"%ld/%ld",ReadPropertyLong(endian,p1),
1357
1353
ReadPropertyLong(endian,p1+4));
1429
1425
if (tag_value < 0x10000)
1430
1426
(void) FormatMagickString(key,MaxTextExtent,"#%04lx",
1431
(unsigned long) tag_value);
1433
1429
if (tag_value < 0x20000)
1434
1430
(void) FormatMagickString(key,MaxTextExtent,"@%04lx",
1435
(unsigned long) (tag_value & 0xffff));
1431
tag_value & 0xffff);
1437
1433
(void) FormatMagickString(key,MaxTextExtent,"unknown");
1570
1566
static char *TracePSClippath(const unsigned char *blob,size_t length,
1571
const size_t magick_unused(columns),
1572
const size_t magick_unused(rows))
1567
const unsigned long magick_unused(columns),
1568
const unsigned long magick_unused(rows))
1668
1664
for (i=0; i < 3; i++)
1674
1670
yy=ReadPropertyMSBLong(&blob,&length);
1675
1671
xx=ReadPropertyMSBLong(&blob,&length);
1677
1673
if (xx > 2147483647)
1678
x=(ssize_t) xx-4294967295-1;
1680
1676
if (yy > 2147483647)
1681
y=(ssize_t) yy-4294967295-1;
1682
1678
point[i].x=(double) x/4096/4096;
1683
1679
point[i].y=1.0-(double) y/4096/4096;
1779
1775
static char *TraceSVGClippath(const unsigned char *blob,size_t length,
1780
const size_t columns,const size_t rows)
1776
const unsigned long columns,const unsigned long rows)
1808
1804
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
1809
1805
(void) ConcatenateString(&path,message);
1810
1806
(void) FormatMagickString(message,MaxTextExtent,
1811
"<svg width=\"%.20g\" height=\"%.20g\">\n",(double) columns,(double) rows);
1807
"<svg width=\"%lu\" height=\"%lu\">\n",columns,rows);
1812
1808
(void) ConcatenateString(&path,message);
1813
1809
(void) FormatMagickString(message,MaxTextExtent,"<g>\n");
1814
1810
(void) ConcatenateString(&path,message);
1865
1861
for (i=0; i < 3; i++)
1871
1867
yy=ReadPropertyMSBLong(&blob,&length);
1872
1868
xx=ReadPropertyMSBLong(&blob,&length);
1874
1870
if (xx > 2147483647)
1875
x=(ssize_t) xx-4294967295-1;
1877
1873
if (yy > 2147483647)
1878
y=(ssize_t) yy-4294967295-1;
1879
1875
point[i].x=(double) x*columns/4096/4096;
1880
1876
point[i].y=(double) y*rows/4096/4096;
2171
2167
Image channels.
2173
2169
(void) FormatMagickString(value,MaxTextExtent,"%s",
2174
MagickOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
2170
MagickOptionToMnemonic(MagickColorspaceOptions,(long)
2175
2171
image->colorspace));
2176
2172
LocaleLower(value);
2177
2173
if (image->matte != MagickFalse)
2190
2186
if (IsGrayImage(image,&image->exception) != MagickFalse)
2191
2187
colorspace=GRAYColorspace;
2192
2188
(void) FormatMagickString(value,MaxTextExtent,"%s",
2193
MagickOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
2189
MagickOptionToMnemonic(MagickColorspaceOptions,(long) colorspace));
2201
2196
if (LocaleNCompare("depth",property,5) == 0)
2203
(void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
2198
(void) FormatMagickString(value,MaxTextExtent,"%lu",image->depth);
2207
2201
if (LocaleNCompare("directory",property,9) == 0)
2227
2221
if (LocaleNCompare("group",property,5) == 0)
2229
2223
(void) FormatMagickString(value,MaxTextExtent,"0x%lx",
2230
(unsigned long) image_info->group);
2237
2231
if (LocaleNCompare("height",property,6) == 0)
2239
(void) FormatMagickString(value,MaxTextExtent,"%.20g",
2240
image->magick_rows != 0 ? (double) image->magick_rows : 256.0);
2233
(void) FormatMagickString(value,MaxTextExtent,"%lu",
2234
image->magick_rows != 0 ? image->magick_rows : 256UL);
2335
2329
register const Image
2342
2336
for (page=1; GetPreviousImageInList(p) != (Image *) NULL; page++)
2343
2337
p=GetPreviousImageInList(p);
2344
(void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
2338
(void) FormatMagickString(value,MaxTextExtent,"%lu",page);
2355
2348
format[MaxTextExtent];
2357
2350
(void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
2358
(void) FormatMagickString(value,MaxTextExtent,"%sB",format);
2351
(void) FormatMagickString(value,MaxTextExtent,"%s",format);
2361
2354
if (LocaleNCompare("scenes",property,6) == 0)
2363
(void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
2364
GetImageListLength(image));
2356
(void) FormatMagickString(value,MaxTextExtent,"%lu",
2357
(unsigned long) GetImageListLength(image));
2367
2360
if (LocaleNCompare("scene",property,5) == 0)
2369
(void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
2362
(void) FormatMagickString(value,MaxTextExtent,"%lu",image->scene);
2371
2363
if (image_info->number_scenes != 0)
2372
(void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
2364
(void) FormatMagickString(value,MaxTextExtent,"%lu",
2373
2365
image_info->scene);
2415
2407
if (LocaleNCompare("width",property,5) == 0)
2417
(void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
2418
(image->magick_columns != 0 ? image->magick_columns : 256));
2409
(void) FormatMagickString(value,MaxTextExtent,"%lu",
2410
image->magick_columns != 0 ? image->magick_columns : 256UL);
2621
(void) FormatMagickString(format,MaxTextExtent,"%.20g",(double)
2613
(void) FormatMagickString(format,MaxTextExtent,"%lu",(unsigned long)
2622
2614
image->extent);
2623
2615
if (image->extent != (MagickSizeType) ((size_t) image->extent))
2624
2616
(void) FormatMagickSize(image->extent,MagickFalse,format);
2625
2617
q+=ConcatenateMagickString(q,format,extent);
2626
q+=ConcatenateMagickString(q,"B",extent);
2705
2696
Image geometry.
2707
q+=FormatMagickString(q,extent,"%.20gx%.20g%+.20g%+.20g",(double)
2708
image->page.width,(double) image->page.height,(double)
2709
image->page.x,(double) image->page.y);
2698
q+=FormatMagickString(q,extent,"%lux%lu%+ld%+ld",image->page.width,
2699
image->page.height,image->page.x,image->page.y);
2717
q+=FormatMagickString(q,extent,"%.20g",(double)
2718
(image->rows != 0 ? image->rows : image->magick_rows));
2707
q+=FormatMagickString(q,extent,"%lu",image->rows != 0 ? image->rows :
2708
image->magick_rows);
2732
2722
Number of unique colors.
2734
q+=FormatMagickString(q,extent,"%.20g",(double)
2735
GetNumberColors(image,(FILE *) NULL,&image->exception));
2724
q+=FormatMagickString(q,extent,"%lu",GetNumberColors(image,
2725
(FILE *) NULL,&image->exception));
2778
2768
Number of images in the list.
2780
q+=FormatMagickString(q,extent,"%.20g",(double)
2770
q+=FormatMagickString(q,extent,"%lu",(unsigned long)
2781
2771
GetImageListLength(image));
2804
2794
for (page=1; GetPreviousImageInList(p) != (Image *) NULL; page++)
2805
2795
p=GetPreviousImageInList(p);
2806
q+=FormatMagickString(q,extent,"%.20g",(double) page);
2796
q+=FormatMagickString(q,extent,"%lu",page);
2814
q+=FormatMagickString(q,extent,"%.20g",(double) image->depth);
2804
q+=FormatMagickString(q,extent,"%lu",image->depth);
2826
2816
if (IsGrayImage(image,&image->exception) != MagickFalse)
2827
2817
colorspace=GRAYColorspace;
2828
2818
q+=FormatMagickString(q,extent,"%s%s%s",MagickOptionToMnemonic(
2829
MagickClassOptions,(ssize_t) image->storage_class),
2830
MagickOptionToMnemonic(MagickColorspaceOptions,(ssize_t) colorspace),
2819
MagickClassOptions,(long) image->storage_class),
2820
MagickOptionToMnemonic(MagickColorspaceOptions,(long) colorspace),
2831
2821
image->matte != MagickFalse ? "Matte" : "");
2837
2827
Image scene number.
2839
2829
if (text_info->number_scenes == 0)
2840
q+=FormatMagickString(q,extent,"%.20g",(double) image->scene);
2830
q+=FormatMagickString(q,extent,"%lu",image->scene);
2842
q+=FormatMagickString(q,extent,"%.20g",(double) text_info->scene);
2832
q+=FormatMagickString(q,extent,"%lu",text_info->scene);
2859
q+=FormatMagickString(q,extent,"%.20g",(double)
2860
(image->columns != 0 ? image->columns : image->magick_columns));
2849
q+=FormatMagickString(q,extent,"%lu",image->columns != 0 ?
2850
image->columns : image->magick_columns);
2866
2856
Image horizontal resolution.
2868
2858
q+=FormatMagickString(q,extent,"%g %s",image->x_resolution,
2869
MagickOptionToMnemonic(MagickResolutionOptions,(ssize_t)
2859
MagickOptionToMnemonic(MagickResolutionOptions,(long) image->units));
2876
2865
Image vertical resolution.
2878
2867
q+=FormatMagickString(q,extent,"%g %s",image->y_resolution,
2879
MagickOptionToMnemonic(MagickResolutionOptions,(ssize_t)
2868
MagickOptionToMnemonic(MagickResolutionOptions,(long) image->units));
2888
q+=FormatMagickString(q,extent,"%.20g",(double) image->depth);
2876
q+=FormatMagickString(q,extent,"%lu",image->depth);
2894
2882
Image alpha channel.
2896
2884
q+=FormatMagickString(q,extent,"%s",MagickOptionToMnemonic(
2897
MagickBooleanOptions,(ssize_t) image->matte));
2885
MagickBooleanOptions,(long) image->matte));
2903
2891
Image compression method.
2905
2893
q+=FormatMagickString(q,extent,"%s",MagickOptionToMnemonic(
2906
MagickCompressOptions,(ssize_t) image->compression));
2894
MagickCompressOptions,(long) image->compression));
2912
2900
Image dispose method.
2914
2902
q+=FormatMagickString(q,extent,"%s",MagickOptionToMnemonic(
2915
MagickDisposeOptions,(ssize_t) image->dispose));
2903
MagickDisposeOptions,(long) image->dispose));
2920
q+=FormatMagickString(q,extent,"%.20gx%.20g",(double)
2921
image->magick_columns,(double) image->magick_rows);
2908
q+=FormatMagickString(q,extent,"%lux%lu",image->magick_columns,
2909
image->magick_rows);
2926
q+=FormatMagickString(q,extent,"%.20g",(double)
2927
image->page.height);
2914
q+=FormatMagickString(q,extent,"%ld",image->page.height);
2932
q+=FormatMagickString(q,extent,"%+ld%+ld",(long) image->page.x,
2933
(long) image->page.y);
2919
q+=FormatMagickString(q,extent,"%+ld%+ld",image->page.x,image->page.y);
2938
q+=FormatMagickString(q,extent,"%.20gx%.20g",(double) image->page.width,
2939
(double) image->page.height);
2924
q+=FormatMagickString(q,extent,"%lux%lu",image->page.width,
2925
image->page.height);
2944
q+=FormatMagickString(q,extent,"%.20g",(double) image->quality);
2930
q+=FormatMagickString(q,extent,"%lu",image->quality);
2952
2938
if (text_info->number_scenes == 0)
2953
2939
q+=CopyMagickString(q,"2147483647",extent);
2955
q+=FormatMagickString(q,extent,"%.20g",(double)
2956
(text_info->scene+text_info->number_scenes));
2941
q+=FormatMagickString(q,extent,"%lu",text_info->scene+
2942
text_info->number_scenes);
2961
q+=FormatMagickString(q,extent,"%.20g",(double) image->delay);
2947
q+=FormatMagickString(q,extent,"%lu",image->delay);
2966
q+=FormatMagickString(q,extent,"%.20g",(double) image->page.width);
2952
q+=FormatMagickString(q,extent,"%ld",image->page.width);
2971
q+=FormatMagickString(q,extent,"%+.20g",(double) image->page.x);
2957
q+=FormatMagickString(q,extent,"%+ld",image->page.x);
2976
q+=FormatMagickString(q,extent,"%+.20g",(double) image->page.y);
2962
q+=FormatMagickString(q,extent,"%+ld",image->page.y);
3111
3095
Image bounding box.
3113
3097
page=GetImageBoundingBox(image,&image->exception);
3114
q+=FormatMagickString(q,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
3115
(double) page.width,(double) page.height,(double) page.x,(double)
3098
q+=FormatMagickString(q,MaxTextExtent,"%lux%lu%+ld%+ld",page.width,
3099
page.height,page.x,page.y);
3343
3326
flags=ParseGeometry(value,&geometry_info);
3344
3327
if ((flags & GreaterValue) != 0)
3346
if (image->delay > (size_t) floor(geometry_info.rho+0.5))
3347
image->delay=(size_t) floor(geometry_info.rho+0.5);
3329
if (image->delay > (unsigned long) (geometry_info.rho+0.5))
3330
image->delay=(unsigned long) (geometry_info.rho+0.5);
3350
3333
if ((flags & LessValue) != 0)
3352
if (image->delay < (size_t) floor(geometry_info.rho+0.5))
3353
image->ticks_per_second=(ssize_t) floor(geometry_info.sigma+0.5);
3335
if (image->delay < (unsigned long) (geometry_info.rho+0.5))
3336
image->ticks_per_second=(long) (geometry_info.sigma+0.5);
3356
image->delay=(size_t) floor(geometry_info.rho+0.5);
3339
image->delay=(unsigned long) (geometry_info.rho+0.5);
3357
3340
if ((flags & SigmaValue) != 0)
3358
image->ticks_per_second=(ssize_t) floor(geometry_info.sigma+0.5);
3341
image->ticks_per_second=(long) (geometry_info.sigma+0.5);
3361
3344
if (LocaleCompare(property,"depth") == 0)
3452
3435
geometry=DestroyString(geometry);
3455
if (LocaleCompare(property,"profile") == 0)
3463
image_info=AcquireImageInfo();
3464
(void) CopyMagickString(image_info->filename,value,MaxTextExtent);
3465
(void) SetImageInfo(image_info,1,&image->exception);
3466
profile=FileToStringInfo(image_info->filename,~0UL,&image->exception);
3467
if (profile != (StringInfo *) NULL)
3468
status=SetImageProfile(image,image_info->magick,profile);
3469
image_info=DestroyImageInfo(image_info);
3472
3438
status=AddValueToSplayTree((SplayTreeInfo *) image->properties,
3473
3439
ConstantString(property),ConstantString(value));