sign,
sense;
- unsigned int
+ size_t
line_pad,
channel_pad;
typedef struct _CINFileInfo
{
- unsigned int
+ size_t
magic,
image_offset,
generic_length,
offset,
reserve1;
- unsigned int
+ size_t
prefix,
count;
char
format[32];
- unsigned int
+ size_t
frame_position;
float
bits_per_pixel,
reserve;
- unsigned int
+ size_t
pixels_per_line,
lines_per_image;
typedef struct _CINOriginationInfo
{
- int
+ ssize_t
x_offset,
y_offset;
(void) ResetMagickMemory(&cin,0,sizeof(cin));
offset=0;
cin.file.magic=0x802A5FD7UL;
- offset+=WriteBlobLong(image,cin.file.magic);
+ offset+=WriteBlobLong(image,(unsigned int) cin.file.magic);
cin.file.image_offset=0x800;
profile=GetImageProfile(image,"cin:user.data");
if (profile != (StringInfo *) NULL)
cin.file.image_offset+=(size_t) GetStringInfoLength(profile);
cin.file.image_offset=(((cin.file.image_offset+0x2000-1)/0x2000)*0x2000);
}
- offset+=WriteBlobLong(image,cin.file.image_offset);
+ offset+=WriteBlobLong(image,(unsigned int) cin.file.image_offset);
cin.file.generic_length=0x400;
- offset+=WriteBlobLong(image,cin.file.generic_length);
+ offset+=WriteBlobLong(image,(unsigned int) cin.file.generic_length);
cin.file.industry_length=0x400;
- offset+=WriteBlobLong(image,cin.file.industry_length);
+ offset+=WriteBlobLong(image,(unsigned int) cin.file.industry_length);
cin.file.user_length=0x00;
if (profile != (StringInfo *) NULL)
{
cin.file.user_length+=(size_t) GetStringInfoLength(profile);
cin.file.user_length=(((cin.file.user_length+0x2000-1)/0x2000)*0x2000);
}
- offset+=WriteBlobLong(image,cin.file.user_length);
+ offset+=WriteBlobLong(image,(unsigned int) cin.file.user_length);
cin.file.file_size=4*image->columns*image->rows+0x2000;
- offset+=WriteBlobLong(image,cin.file.file_size);
+ offset+=WriteBlobLong(image,(unsigned int) cin.file.file_size);
(void) CopyMagickString(cin.file.version,"V4.5",sizeof(cin.file.version));
offset+=WriteBlob(image,sizeof(cin.file.version),(unsigned char *)
cin.file.version);
offset+=WriteBlobByte(image,cin.image.channel[0].bits_per_pixel);
offset+=WriteBlobByte(image,cin.image.channel[0].reserve);
cin.image.channel[i].pixels_per_line=image->columns;
- offset+=WriteBlobLong(image,cin.image.channel[0].pixels_per_line);
+ offset+=WriteBlobLong(image,(unsigned int)
+ cin.image.channel[0].pixels_per_line);
cin.image.channel[i].lines_per_image=image->rows;
- offset+=WriteBlobLong(image,cin.image.channel[0].lines_per_image);
+ offset+=WriteBlobLong(image,(unsigned int)
+ cin.image.channel[0].lines_per_image);
cin.image.channel[i].min_data=0;
offset+=WriteBlobFloat(image,cin.image.channel[0].min_data);
cin.image.channel[i].min_quantity=0.0;
cin.data_format.sense=0; /* image sense: positive image */
offset+=WriteBlobByte(image,cin.data_format.sense);
cin.data_format.line_pad=0;
- offset+=WriteBlobLong(image,cin.data_format.line_pad);
+ offset+=WriteBlobLong(image,(unsigned int) cin.data_format.line_pad);
cin.data_format.channel_pad=0;
- offset+=WriteBlobLong(image,cin.data_format.channel_pad);
+ offset+=WriteBlobLong(image,(unsigned int) cin.data_format.channel_pad);
offset+=WriteBlob(image,sizeof(cin.data_format.reserve),(unsigned char *)
cin.data_format.reserve);
/*
value=GetCINProperty(image_info,image,"cin:film.prefix");
if (value != (const char *) NULL)
cin.film.prefix=StringToUnsignedLong(value);
- offset+=WriteBlobLong(image,cin.film.prefix);
+ offset+=WriteBlobLong(image,(unsigned int) cin.film.prefix);
cin.film.count=0UL;
value=GetCINProperty(image_info,image,"cin:film.count");
if (value != (const char *) NULL)
cin.film.count=StringToUnsignedLong(value);
- offset+=WriteBlobLong(image,cin.film.count);
+ offset+=WriteBlobLong(image,(unsigned int) cin.film.count);
value=GetCINProperty(image_info,image,"cin:film.format");
if (value != (const char *) NULL)
(void) CopyMagickString(cin.film.format,value,sizeof(cin.film.format));
value=GetCINProperty(image_info,image,"cin:film.frame_position");
if (value != (const char *) NULL)
cin.film.frame_position=StringToUnsignedLong(value);
- offset+=WriteBlobLong(image,cin.film.frame_position);
+ offset+=WriteBlobLong(image,(unsigned int) cin.film.frame_position);
cin.film.frame_rate=0.0f;
value=GetCINProperty(image_info,image,"cin:film.frame_rate");
if (value != (const char *) NULL)
*/
typedef struct _DIBInfo
{
- unsigned int
+ size_t
size;
- int
+ ssize_t
width,
height;
planes,
bits_per_pixel;
- unsigned int
+ size_t
compression,
image_size,
x_pixels,
alpha_mask,
colors_important;
- int
+ ssize_t
colorspace;
PointInfo
*q++=(unsigned char)(word >> 8);
p++;
}
- for (x=2L*image->columns; x < (ssize_t) bytes_per_line; x++)
+ for (x=(ssize_t) (2*image->columns); x < (ssize_t) bytes_per_line; x++)
*q++=0x00;
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
image->rows);
p++;
}
if (dib_info.bits_per_pixel == 24)
- for (x=3L*image->columns; x < (ssize_t) bytes_per_line; x++)
+ for (x=(ssize_t) (3*image->columns); x < (ssize_t) bytes_per_line; x++)
*q++=0x00;
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
image->rows);
/*
Write DIB header.
*/
- (void) WriteBlobLSBLong(image,dib_info.size);
+ (void) WriteBlobLSBLong(image,(unsigned int) dib_info.size);
(void) WriteBlobLSBLong(image,dib_info.width);
(void) WriteBlobLSBLong(image,(unsigned short) dib_info.height);
(void) WriteBlobLSBShort(image,(unsigned short) dib_info.planes);
(void) WriteBlobLSBShort(image,dib_info.bits_per_pixel);
- (void) WriteBlobLSBLong(image,dib_info.compression);
- (void) WriteBlobLSBLong(image,dib_info.image_size);
- (void) WriteBlobLSBLong(image,dib_info.x_pixels);
- (void) WriteBlobLSBLong(image,dib_info.y_pixels);
- (void) WriteBlobLSBLong(image,dib_info.number_colors);
- (void) WriteBlobLSBLong(image,dib_info.colors_important);
+ (void) WriteBlobLSBLong(image,(unsigned int) dib_info.compression);
+ (void) WriteBlobLSBLong(image,(unsigned int) dib_info.image_size);
+ (void) WriteBlobLSBLong(image,(unsigned int) dib_info.x_pixels);
+ (void) WriteBlobLSBLong(image,(unsigned int) dib_info.y_pixels);
+ (void) WriteBlobLSBLong(image,(unsigned int) dib_info.number_colors);
+ (void) WriteBlobLSBLong(image,(unsigned int) dib_info.colors_important);
if (image->storage_class == PseudoClass)
{
if (dib_info.bits_per_pixel <= 8)
Initialize JBIG toolkit.
*/
jbg_dec_init(&jbig_info);
- jbg_dec_maxsize(&jbig_info,(size_t) image->columns,(size_t)
+ jbg_dec_maxsize(&jbig_info,(unsigned long) image->columns,(unsigned long)
image->rows);
image->columns=jbg_dec_getwidth(&jbig_info);
image->rows=jbg_dec_getheight(&jbig_info);
/*
Initialize JBIG info structure.
*/
- jbg_enc_init(&jbig_info,image->columns,image->rows,1,&pixels,
- (void (*)(unsigned char *,size_t,void *)) JBIGEncode,image);
+ jbg_enc_init(&jbig_info,(unsigned long) image->columns,(unsigned long)
+ image->rows,1,&pixels,(void (*)(unsigned char *,size_t,void *))
+ JBIGEncode,image);
if (image_info->scene != 0)
jbg_enc_layers(&jbig_info,(int) image_info->scene);
else
x_resolution=(size_t) (100.0*2.54*x_resolution+0.5)/100.0;
y_resolution=(size_t) (100.0*2.54*y_resolution+0.5)/100.0;
}
- (void) jbg_enc_lrlmax(&jbig_info,x_resolution,y_resolution);
+ (void) jbg_enc_lrlmax(&jbig_info,(unsigned long) x_resolution,
+ (unsigned long) y_resolution);
}
(void) jbg_enc_lrange(&jbig_info,-1,-1);
jbg_enc_options(&jbig_info,JBG_ILEAVE | JBG_SMID,JBG_TPDON | JBG_TPBON |
break;
for (i=0; i < (ssize_t) number_components; i++)
(void) jas_image_readcmpt(jp2_image,(short) components[i],0,
- ((unsigned int) y)/y_step[i],((unsigned int) image->columns)/x_step[i],
- 1,pixels[i]);
+ (jas_image_coord_t) (y/y_step[i]),(jas_image_coord_t) (image->columns/
+ x_step[i]),1,pixels[i]);
switch (number_components)
{
case 1:
char identific[124];
unsigned short Version;
char EndianIndicator[2];
- size_t DataType;
- size_t ObjectSize;
- size_t unknown1;
- size_t unknown2;
+ unsigned long DataType;
+ unsigned long ObjectSize;
+ unsigned long unknown1;
+ unsigned long unknown2;
unsigned short unknown5;
unsigned char StructureFlag;
unsigned char StructureClass;
- size_t unknown3;
- size_t unknown4;
- size_t DimFlag;
+ unsigned long unknown3;
+ unsigned long unknown4;
+ unsigned long DimFlag;
- size_t SizeX;
- size_t SizeY;
+ unsigned long SizeX;
+ unsigned long SizeY;
unsigned short Flag1;
unsigned short NameFlag;
}
padding=((unsigned char)(DataSize-1) & 0x7) ^ 0x7;
(void) WriteBlobLSBLong(image, miMATRIX);
- (void) WriteBlobLSBLong(image, DataSize+padding+(is_gray ? 48l : 56l));
+ (void) WriteBlobLSBLong(image, (unsigned int) DataSize+padding+(is_gray ? 48 : 56));
(void) WriteBlobLSBLong(image, 0x6); /* 0x88 */
(void) WriteBlobLSBLong(image, 0x8); /* 0x8C */
(void) WriteBlobLSBLong(image, 0x6); /* 0x90 */
(void) WriteBlobLSBLong(image, 0);
(void) WriteBlobLSBLong(image, 0x5); /* 0x98 */
(void) WriteBlobLSBLong(image, is_gray ? 0x8 : 0xC); /* 0x9C - DimFlag */
- (void) WriteBlobLSBLong(image, image->rows); /* x: 0xA0 */
- (void) WriteBlobLSBLong(image, image->columns); /* y: 0xA4 */
+ (void) WriteBlobLSBLong(image, (unsigned int) image->rows); /* x: 0xA0 */
+ (void) WriteBlobLSBLong(image, (unsigned int) image->columns); /* y: 0xA4 */
if(!is_gray)
{
(void) WriteBlobLSBLong(image, 3); /* z: 0xA8 */
(void) WriteBlobLSBShort(image, 1); /* 0xB2 */
(void) WriteBlobLSBLong(image, 'M'); /* 0xB4 */
(void) WriteBlobLSBLong(image, 0x2); /* 0xB8 */
- (void) WriteBlobLSBLong(image, DataSize); /* 0xBC */
+ (void) WriteBlobLSBLong(image, (unsigned int) DataSize); /* 0xBC */
/*
Store image data.
/*
Write the Image record header.
*/
- (void) WriteBlobMSBLong(image,(size_t)
+ (void) WriteBlobMSBLong(image,(unsigned int)
(TellBlob(image)+8*pdb_info.number_records));
(void) WriteBlobByte(image,0x40);
(void) WriteBlobByte(image,0x6f);
/*
Write the comment record header.
*/
- (void) WriteBlobMSBLong(image,(size_t) (TellBlob(image)+8+58+q-
+ (void) WriteBlobMSBLong(image,(unsigned int) (TellBlob(image)+8+58+q-
runlength));
(void) WriteBlobByte(image,0x40);
(void) WriteBlobByte(image,0x6f);
SetStringInfoLength(iptc_profile,length);
if (TIFFIsByteSwapped(tiff))
TIFFSwabArrayOfLong((uint32 *) GetStringInfoDatum(iptc_profile),
- (size_t) (length/4));
+ (unsigned long) (length/4));
(void) TIFFSetField(tiff,TIFFTAG_RICHTIFFIPTC,(uint32)
GetStringInfoLength(iptc_profile)/4,GetStringInfoDatum(iptc_profile));
iptc_profile=DestroyStringInfo(iptc_profile);
(void) TIFFSetField(tiff,TIFFTAG_PLANARCONFIG,PLANARCONFIG_SEPARATE);
rows_per_strip=1;
if (TIFFScanlineSize(tiff) != 0)
- rows_per_strip=(size_t) MagickMax((size_t)
- TIFFDefaultStripSize(tiff,0),1);
+ rows_per_strip=(uint32) MagickMax((size_t) TIFFDefaultStripSize(tiff,0),
+ 1);
option=GetImageOption(image_info,"tiff:rows-per-strip");
if (option != (const char *) NULL)
rows_per_strip=(size_t) strtol(option,(char **) NULL,10);
}
case COMPRESSION_ADOBE_DEFLATE:
{
- rows_per_strip=image->rows;
+ rows_per_strip=(uint32) image->rows;
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_BITSPERSAMPLE,
&bits_per_sample);
if (((photometric == PHOTOMETRIC_RGB) ||
(photometric == PHOTOMETRIC_MINISBLACK)) &&
((bits_per_sample == 8) || (bits_per_sample == 16)))
(void) TIFFSetField(tiff,TIFFTAG_PREDICTOR,2);
- (void) TIFFSetField(tiff,TIFFTAG_ZIPQUALITY,image_info->quality ==
- UndefinedCompressionQuality ? 7 : (long) MagickMin(1L*
- image_info->quality/10,9));
+ (void) TIFFSetField(tiff,TIFFTAG_ZIPQUALITY,(long) (
+ image_info->quality == UndefinedCompressionQuality ? 7 :
+ MagickMin(1*image_info->quality/10,9)));
break;
}
case COMPRESSION_CCITTFAX3:
(void) WriteBlob(image,512,(unsigned char *) viff_info.comment);
(void) WriteBlobMSBLong(image,viff_info.rows);
(void) WriteBlobMSBLong(image,viff_info.columns);
- (void) WriteBlobMSBLong(image,viff_info.subrows);
- (void) WriteBlobMSBLong(image,(size_t) viff_info.x_offset);
- (void) WriteBlobMSBLong(image,(size_t) viff_info.y_offset);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.subrows);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.x_offset);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.y_offset);
viff_info.x_bits_per_pixel=1U*(63 << 24) | (128 << 16);
- (void) WriteBlobMSBLong(image,(size_t) viff_info.x_bits_per_pixel);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.x_bits_per_pixel);
viff_info.y_bits_per_pixel=1U*(63 << 24) | (128 << 16);
- (void) WriteBlobMSBLong(image,(size_t) viff_info.y_bits_per_pixel);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.y_bits_per_pixel);
(void) WriteBlobMSBLong(image,viff_info.location_type);
(void) WriteBlobMSBLong(image,viff_info.location_dimension);
- (void) WriteBlobMSBLong(image,viff_info.number_of_images);
- (void) WriteBlobMSBLong(image,viff_info.number_data_bands);
- (void) WriteBlobMSBLong(image,viff_info.data_storage_type);
- (void) WriteBlobMSBLong(image,viff_info.data_encode_scheme);
- (void) WriteBlobMSBLong(image,viff_info.map_scheme);
- (void) WriteBlobMSBLong(image,viff_info.map_storage_type);
- (void) WriteBlobMSBLong(image,viff_info.map_rows);
- (void) WriteBlobMSBLong(image,viff_info.map_columns);
- (void) WriteBlobMSBLong(image,viff_info.map_subrows);
- (void) WriteBlobMSBLong(image,viff_info.map_enable);
- (void) WriteBlobMSBLong(image,viff_info.maps_per_cycle);
- (void) WriteBlobMSBLong(image,viff_info.color_space_model);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.number_of_images);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.number_data_bands);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.data_storage_type);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.data_encode_scheme);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_scheme);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_storage_type);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_rows);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_columns);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_subrows);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.map_enable);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.maps_per_cycle);
+ (void) WriteBlobMSBLong(image,(unsigned int) viff_info.color_space_model);
for (i=0; i < 420; i++)
(void) WriteBlobByte(image,'\0');
/*