...
diff --git a/coders/aai.c b/coders/aai.c
index ff380fa..37e185f 100644
--- a/coders/aai.c
+++ b/coders/aai.c
@@ -341,6 +341,9 @@
register unsigned char
*magick_restrict q;
+ size_t
+ imageListLength;
+
ssize_t
count,
y;
@@ -363,6 +366,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -414,8 +418,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/avs.c b/coders/avs.c
index b4ecb5e..43ec043 100644
--- a/coders/avs.c
+++ b/coders/avs.c
@@ -343,6 +343,9 @@
register unsigned char
*magick_restrict q;
+ size_t
+ imageListLength;
+
ssize_t
count,
y;
@@ -365,6 +368,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -413,8 +417,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/bgr.c b/coders/bgr.c
index 3087752..aecfca4 100644
--- a/coders/bgr.c
+++ b/coders/bgr.c
@@ -1123,6 +1123,9 @@
size_t
length;
+ size_t
+ imageListLength;
+
ssize_t
count,
y;
@@ -1145,8 +1148,8 @@
Open output image file.
*/
assert(exception != (ExceptionInfo *) NULL);
- assert(exception->signature == MagickCoreSignature);
- status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
+ assert(exception->signature == MagickCoreSignature);
+ status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
}
@@ -1157,6 +1160,7 @@
image->alpha_trait=BlendPixelTrait;
}
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1474,8 +1478,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/bmp.c b/coders/bmp.c
index 6a9912b..e1f2c2b 100644
--- a/coders/bmp.c
+++ b/coders/bmp.c
@@ -1615,6 +1615,7 @@
size_t
bytes_per_line,
+ imageListLength,
type;
ssize_t
@@ -1644,13 +1645,11 @@
else
if (LocaleCompare(image_info->magick,"BMP3") == 0)
type=3;
-
option=GetImageOption(image_info,"bmp:format");
if (option != (char *) NULL)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Format=%s",option);
-
if (LocaleCompare(option,"bmp2") == 0)
type=2;
if (LocaleCompare(option,"bmp3") == 0)
@@ -1658,8 +1657,8 @@
if (LocaleCompare(option,"bmp4") == 0)
type=4;
}
-
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -2345,8 +2344,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/cmyk.c b/coders/cmyk.c
index cd14c07..e3ef431 100644
--- a/coders/cmyk.c
+++ b/coders/cmyk.c
@@ -1227,6 +1227,7 @@
quantum_type;
size_t
+ imageListLength,
length;
ssize_t
@@ -1255,6 +1256,7 @@
return(status);
}
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1627,8 +1629,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/dcm.c b/coders/dcm.c
index 879304c..3890664 100644
--- a/coders/dcm.c
+++ b/coders/dcm.c
@@ -3491,7 +3491,7 @@
if (info.significant_bits > 8)
info.bytes_per_pixel=2;
info.depth=info.significant_bits;
- if ((info.depth == 0) || (info.depth > 32))
+ if ((info.depth == 0) || (info.depth > 16))
ThrowDCMException(CorruptImageError,"ImproperImageHeader");
info.max_value=(1UL << info.significant_bits)-1;
info.mask=(size_t) GetQuantumRange(info.significant_bits);
diff --git a/coders/debug.c b/coders/debug.c
index a334073..a2a038f 100644
--- a/coders/debug.c
+++ b/coders/debug.c
@@ -187,6 +187,9 @@
register ssize_t
x;
+ size_t
+ imageListLength;
+
/*
Open output image file.
*/
@@ -200,6 +203,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
(void) CopyMagickString(colorspace,CommandOptionToMnemonic(
@@ -257,8 +261,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/fax.c b/coders/fax.c
index f7f44ca..c9f6229 100644
--- a/coders/fax.c
+++ b/coders/fax.c
@@ -362,6 +362,9 @@
MagickOffsetType
scene;
+ size_t
+ imageListLength;
+
/*
Open output image file.
*/
@@ -379,6 +382,7 @@
write_info=CloneImageInfo(image_info);
(void) CopyMagickString(write_info->magick,"FAX",MagickPathExtent);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -389,8 +393,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (write_info->adjoin != MagickFalse);
diff --git a/coders/flif.c b/coders/flif.c
index f7018c5..5c0b770 100644
--- a/coders/flif.c
+++ b/coders/flif.c
@@ -409,6 +409,7 @@
size_t
columns,
+ imageListLength,
length,
rows;
@@ -469,7 +470,7 @@
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
scene=0;
-
+ imageListLength=GetImageListLength(image);
do
{
for (y=0; y < (ssize_t) image->rows; y++)
@@ -525,12 +526,10 @@
ThrowWriterException(ImageError,"FramesNotSameDimensions");
}
scene++;
- status=SetImageProgress(image,SaveImagesTag,scene,GetImageListLength(
- image));
+ status=SetImageProgress(image,SaveImagesTag,scene,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
-
flif_destroy_image(flifimage);
pixels=RelinquishMagickMemory(pixels);
flif_status=flif_encoder_encode_memory(flifenc,&buffer,&length);
diff --git a/coders/gif.c b/coders/gif.c
index 6e42197..25aab91 100644
--- a/coders/gif.c
+++ b/coders/gif.c
@@ -1522,6 +1522,7 @@
size_t
bits_per_pixel,
delay,
+ imageListLength,
length,
one;
@@ -1597,6 +1598,7 @@
write_info->interlace=NoInterlace;
scene=0;
one=1;
+ imageListLength=GetImageListLength(image);
do
{
(void) TransformImageColorspace(image,sRGBColorspace,exception);
@@ -1924,8 +1926,7 @@
break;
image=SyncNextImageInList(image);
scene++;
- status=SetImageProgress(image,SaveImagesTag,scene,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene,imageListLength);
if (status == MagickFalse)
break;
} while (write_info->adjoin != MagickFalse);
diff --git a/coders/gray.c b/coders/gray.c
index ec4f299..487a2ce 100644
--- a/coders/gray.c
+++ b/coders/gray.c
@@ -824,6 +824,7 @@
quantum_type;
size_t
+ imageListLength,
length;
ssize_t
@@ -855,6 +856,7 @@
if (LocaleCompare(image_info->magick,"GRAYA") == 0)
quantum_type=GrayAlphaQuantum;
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1070,8 +1072,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/icon.c b/coders/icon.c
index a2268c8..f7bb8a8 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -901,6 +901,7 @@
size_t
bytes_per_line,
+ imageListLength,
scanline_pad;
ssize_t
@@ -971,6 +972,7 @@
} while ((next != (Image *) NULL) && (image_info->adjoin != MagickFalse));
scene=0;
next=(images != (Image *) NULL) ? images : image;
+ imageListLength=GetImageListLength(image);
do
{
if ((next->columns > 255L) && (next->rows > 255L) &&
@@ -1363,8 +1365,7 @@
}
if (GetNextImageInList(next) == (Image *) NULL)
break;
- status=SetImageProgress(next,SaveImagesTag,scene++,
- GetImageListLength(next));
+ status=SetImageProgress(next,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
next=SyncNextImageInList(next);
diff --git a/coders/info.c b/coders/info.c
index 17696bb..fbeb5e2 100644
--- a/coders/info.c
+++ b/coders/info.c
@@ -166,6 +166,9 @@
MagickOffsetType
scene;
+ size_t
+ imageListLength;
+
/*
Open output image file.
*/
@@ -179,6 +182,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
format=GetImageOption(image_info,"format");
@@ -207,8 +211,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/ipl.c b/coders/ipl.c
index e29dac7..fe69900 100644
--- a/coders/ipl.c
+++ b/coders/ipl.c
@@ -523,6 +523,9 @@
QuantumInfo
*quantum_info;
+ size_t
+ imageListLength;
+
ssize_t
y;
@@ -579,7 +582,8 @@
break;
}
- ipl_info.z = (unsigned int) GetImageListLength(image);
+ imageListLength=GetImageListLength(image);
+ ipl_info.z = (unsigned int) imageListLength;
/* There is no current method for detecting whether we have T or Z stacks */
ipl_info.time = 1;
ipl_info.width = (unsigned int) image->columns;
@@ -679,8 +683,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
}while (image_info->adjoin != MagickFalse);
diff --git a/coders/jbig.c b/coders/jbig.c
index e798723..404680b 100644
--- a/coders/jbig.c
+++ b/coders/jbig.c
@@ -429,6 +429,7 @@
*q;
size_t
+ imageListLength,
number_packets;
ssize_t
@@ -458,6 +459,7 @@
return(status);
version=StringToDouble(JBG_VERSION,(char **) NULL);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -555,8 +557,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/json.c b/coders/json.c
index 332b93e..d68aeaa 100644
--- a/coders/json.c
+++ b/coders/json.c
@@ -1691,6 +1691,9 @@
MagickOffsetType
scene;
+ size_t
+ imageListLength;
+
/*
Open output image file.
*/
@@ -1707,6 +1710,7 @@
if (file == (FILE *) NULL)
file=stdout;
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
if (scene == 0)
@@ -1721,8 +1725,7 @@
}
(void) WriteBlobString(image,",\n");
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/mat.c b/coders/mat.c
index 1cbb596..a1531bc 100644
--- a/coders/mat.c
+++ b/coders/mat.c
@@ -1560,6 +1560,9 @@
MagickOffsetType
scene;
+ size_t
+ imageListLength;
+
struct tm
local_time;
@@ -1599,6 +1602,7 @@
MATLAB_HDR[0x7F]='M';
(void) WriteBlob(image,sizeof(MATLAB_HDR),(unsigned char *) MATLAB_HDR);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
char
@@ -1686,8 +1690,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/miff.c b/coders/miff.c
index 5c9e842..6ceb487 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -2023,6 +2023,7 @@
i;
size_t
+ imageListLength,
length,
packet_size;
@@ -2054,6 +2055,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -2769,8 +2771,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,GetImageListLength(
- image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/mpc.c b/coders/mpc.c
index d515003..b6e3676 100644
--- a/coders/mpc.c
+++ b/coders/mpc.c
@@ -1140,7 +1140,8 @@
i;
size_t
- depth;
+ depth,
+ imageListLength;
/*
Open persistent cache.
@@ -1160,6 +1161,7 @@
AppendImageFormat("cache",cache_filename);
scene=0;
offset=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1530,7 +1532,7 @@
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
status=image->progress_monitor(SaveImagesTag,scene,
- GetImageListLength(image),image->client_data);
+ imageListLength,image->client_data);
if (status == MagickFalse)
break;
}
diff --git a/coders/mtv.c b/coders/mtv.c
index ae3ebee..0489556 100644
--- a/coders/mtv.c
+++ b/coders/mtv.c
@@ -346,6 +346,9 @@
register unsigned char
*q;
+ size_t
+ imageListLength;
+
ssize_t
y;
@@ -367,6 +370,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -409,8 +413,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene,imageListLength);
if (status == MagickFalse)
break;
scene++;
diff --git a/coders/palm.c b/coders/palm.c
index 3210cb6..c7aa8b0 100644
--- a/coders/palm.c
+++ b/coders/palm.c
@@ -719,6 +719,7 @@
count,
bits_per_pixel,
bytes_per_row,
+ imageListLength,
nextDepthOffset,
one;
@@ -763,6 +764,7 @@
one=1;
version=0;
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
(void) TransformImageColorspace(image,sRGBColorspace,exception);
@@ -1022,8 +1024,7 @@
currentOffset=(MagickOffsetType) GetBlobSize(image);
offset=SeekBlob(image,currentOffset,SEEK_SET);
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/pcl.c b/coders/pcl.c
index 088645b..421b460 100644
--- a/coders/pcl.c
+++ b/coders/pcl.c
@@ -677,6 +677,7 @@
size_t
density,
+ imageListLength,
length,
one,
packets;
@@ -715,6 +716,7 @@
}
scene=0;
one=1;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -973,8 +975,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/pcx.c b/coders/pcx.c
index 0c4593b..80008e6 100644
--- a/coders/pcx.c
+++ b/coders/pcx.c
@@ -885,6 +885,7 @@
*q;
size_t
+ imageListLength,
length;
ssize_t
@@ -928,6 +929,7 @@
(void) WriteBlobLSBLong(image,0x00000000L);
}
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
if (page_table != (MagickOffsetType *) NULL)
@@ -1175,8 +1177,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/pdf.c b/coders/pdf.c
index 109196b..c858836 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -1320,6 +1320,7 @@
size_t
channels,
+ imageListLength,
info_id,
length,
object,
@@ -1511,6 +1512,7 @@
(void) WriteBlobString(image,">>\n");
(void) WriteBlobString(image,"endobj\n");
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
MagickBooleanType
@@ -2939,8 +2941,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/pix.c b/coders/pix.c
index 7c8a420..e0f43ba 100644
--- a/coders/pix.c
+++ b/coders/pix.c
@@ -176,7 +176,13 @@
{
if (length == 0)
{
- length=(size_t) ReadBlobByte(image);
+ int
+ c;
+
+ c=ReadBlobByte(image);
+ if ((c == 0) || (c == EOF))
+ break;
+ length=(size_t) c;
if (bits_per_pixel == 8)
index=ScaleCharToQuantum((unsigned char) ReadBlobByte(image));
else
@@ -194,6 +200,8 @@
length--;
q+=GetPixelChannels(image);
}
+ if (x < (ssize_t) image->columns)
+ break;
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
if (image->previous == (Image *) NULL)
diff --git a/coders/png.c b/coders/png.c
index 2cc4c38..2d49cd2 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -13375,6 +13375,7 @@
size_t
final_delay=0,
+ imageListLength,
initial_delay;
#if (PNG_LIBPNG_VER < 10200)
@@ -13988,6 +13989,7 @@
defined(PNG_MNG_FEATURES_SUPPORTED)
mng_info->equal_palettes=MagickFalse;
#endif
+ imageListLength=GetImageListLength(image);
do
{
if (mng_info->adjoin)
@@ -14173,8 +14175,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
diff --git a/coders/pnm.c b/coders/pnm.c
index d72e14d..d3a5d09 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -1519,6 +1519,7 @@
size_t
extent,
+ imageListLength,
packet_size;
ssize_t
@@ -1540,6 +1541,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
QuantumAny
@@ -2431,8 +2433,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/ps.c b/coders/ps.c
index 98f1874..f36f400 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -1552,6 +1552,7 @@
size_t
bit,
byte,
+ imageListLength,
length,
page,
text_size;
@@ -1586,6 +1587,7 @@
compression=image_info->compression;
page=1;
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1742,9 +1744,9 @@
*/
(void) WriteBlobString(image,"%%Orientation: Portrait\n");
(void) WriteBlobString(image,"%%PageOrder: Ascend\n");
- (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Pages: %.20g\n",
- image_info->adjoin != MagickFalse ? (double)
- GetImageListLength(image) : 1.0);
+ (void) FormatLocaleString(buffer,MagickPathExtent,
+ "%%%%Pages: %.20g\n",image_info->adjoin != MagickFalse ?
+ (double) imageListLength : 1.0);
(void) WriteBlobString(image,buffer);
}
(void) WriteBlobString(image,"%%EndComments\n");
@@ -2292,8 +2294,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/ps2.c b/coders/ps2.c
index 105e699..a06066c 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -438,6 +438,7 @@
bounds;
size_t
+ imageListLength,
length,
page,
text_size;
@@ -487,6 +488,7 @@
(void) memset(&bounds,0,sizeof(bounds));
page=1;
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -606,7 +608,7 @@
(void) CopyMagickString(buffer,"%%Pages: 1\n",MagickPathExtent);
else
(void) FormatLocaleString(buffer,MagickPathExtent,
- "%%%%Pages: %.20g\n",(double) GetImageListLength(image));
+ "%%%%Pages: %.20g\n",(double) imageListLength);
(void) WriteBlobString(image,buffer);
}
if (image->colorspace == CMYKColorspace)
@@ -1118,8 +1120,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/ps3.c b/coders/ps3.c
index b8d7832..1a60d24 100644
--- a/coders/ps3.c
+++ b/coders/ps3.c
@@ -866,6 +866,7 @@
bounds;
size_t
+ imageListLength,
length,
page,
pixel,
@@ -933,6 +934,7 @@
(void) memset(&bounds,0,sizeof(bounds));
page=0;
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1070,7 +1072,7 @@
(void) CopyMagickString(buffer,"%%Pages: 1\n",MagickPathExtent);
else
(void) FormatLocaleString(buffer,MagickPathExtent,
- "%%%%Pages: %.20g\n",(double) GetImageListLength(image));
+ "%%%%Pages: %.20g\n",(double) imageListLength);
(void) WriteBlobString(image,buffer);
}
if (image->colorspace == CMYKColorspace)
@@ -1600,8 +1602,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/psd.c b/coders/psd.c
index f0c39d8..424ccb1 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -2075,6 +2075,9 @@
register ssize_t
i;
+ size_t
+ imageListLength;
+
ssize_t
count;
@@ -2321,10 +2324,11 @@
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" reading the precombined layer");
- if ((has_merged_image != MagickFalse) || (GetImageListLength(image) == 1))
+ imageListLength=GetImageListLength(image);
+ if ((has_merged_image != MagickFalse) || (imageListLength == 1))
has_merged_image=(MagickBooleanType) ReadPSDMergedImage(image_info,image,
&psd_info,exception);
- if ((has_merged_image == MagickFalse) && (GetImageListLength(image) == 1) &&
+ if ((has_merged_image == MagickFalse) && (imageListLength == 1) &&
(length != 0))
{
SeekBlob(image,offset,SEEK_SET);
@@ -2344,7 +2348,7 @@
Image
*merged;
- if (GetImageListLength(image) == 1)
+ if (imageListLength == 1)
{
if (profile != (StringInfo *) NULL)
profile=DestroyStringInfo(profile);
diff --git a/coders/raw.c b/coders/raw.c
index b7b4e39..446c525 100644
--- a/coders/raw.c
+++ b/coders/raw.c
@@ -465,6 +465,7 @@
*p;
size_t
+ imageListLength,
length;
ssize_t
@@ -565,6 +566,7 @@
}
}
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -596,8 +598,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/rgb.c b/coders/rgb.c
index f3dc377..8e4c72a 100644
--- a/coders/rgb.c
+++ b/coders/rgb.c
@@ -1108,6 +1108,7 @@
quantum_type;
size_t
+ imageListLength,
length;
ssize_t
@@ -1141,6 +1142,7 @@
if (LocaleCompare(image_info->magick,"RGBO") == 0)
quantum_type=RGBOQuantum;
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1465,8 +1467,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/sgi.c b/coders/sgi.c
index 5660bbe..142035d 100644
--- a/coders/sgi.c
+++ b/coders/sgi.c
@@ -927,6 +927,9 @@
register unsigned char
*q;
+ size_t
+ imageListLength;
+
ssize_t
y,
z;
@@ -952,6 +955,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1175,8 +1179,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/sun.c b/coders/sun.c
index c78fbc0..edf5a83 100644
--- a/coders/sun.c
+++ b/coders/sun.c
@@ -795,6 +795,9 @@
i,
x;
+ size_t
+ imageListLength;
+
ssize_t
y;
@@ -816,6 +819,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1028,8 +1032,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/tiff.c b/coders/tiff.c
index 589a87a..38dcfe5 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -3422,6 +3422,7 @@
i;
size_t
+ imageListLength,
length;
ssize_t
@@ -3480,6 +3481,7 @@
debug=IsEventLogging();
(void) debug;
adjoin=image_info->adjoin;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -3944,12 +3946,12 @@
adjoin=MagickFalse;
}
if ((LocaleCompare(image_info->magick,"PTIF") != 0) &&
- (adjoin != MagickFalse) && (GetImageListLength(image) > 1))
+ (adjoin != MagickFalse) && (imageListLength > 1))
{
(void) TIFFSetField(tiff,TIFFTAG_SUBFILETYPE,FILETYPE_PAGE);
if (image->scene != 0)
(void) TIFFSetField(tiff,TIFFTAG_PAGENUMBER,(uint16) image->scene,
- GetImageListLength(image));
+ imageListLength);
}
if (image->orientation != UndefinedOrientation)
(void) TIFFSetField(tiff,TIFFTAG_ORIENTATION,(uint16) image->orientation);
@@ -3960,7 +3962,7 @@
pages;
page=(uint16) scene;
- pages=(uint16) GetImageListLength(image);
+ pages=(uint16) imageListLength;
if ((LocaleCompare(image_info->magick,"PTIF") != 0) &&
(adjoin != MagickFalse) && (pages > 1))
(void) TIFFSetField(tiff,TIFFTAG_SUBFILETYPE,FILETYPE_PAGE);
@@ -4231,8 +4233,7 @@
image=SyncNextImageInList(image);
if (image == (Image *) NULL)
break;
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (adjoin != MagickFalse);
diff --git a/coders/txt.c b/coders/txt.c
index 4937a7b..a87100f 100644
--- a/coders/txt.c
+++ b/coders/txt.c
@@ -729,6 +729,9 @@
register ssize_t
x;
+ size_t
+ imageListLength;
+
ssize_t
y;
@@ -745,6 +748,7 @@
if (status == MagickFalse)
return(status);
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
ComplianceType
@@ -857,8 +861,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/viff.c b/coders/viff.c
index 6470564..92809e4 100644
--- a/coders/viff.c
+++ b/coders/viff.c
@@ -961,6 +961,9 @@
register unsigned char
*q;
+ size_t
+ imageListLength;
+
ssize_t
y;
@@ -986,6 +989,7 @@
return(status);
(void) memset(&viff_info,0,sizeof(ViffInfo));
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1259,8 +1263,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/ycbcr.c b/coders/ycbcr.c
index da6e238..1c323ef 100644
--- a/coders/ycbcr.c
+++ b/coders/ycbcr.c
@@ -1102,6 +1102,7 @@
*p;
size_t
+ imageListLength,
length;
ssize_t
@@ -1138,6 +1139,7 @@
image->alpha_trait=BlendPixelTrait;
}
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -1419,8 +1421,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
diff --git a/coders/yuv.c b/coders/yuv.c
index df3d2b0..8c6d79a 100644
--- a/coders/yuv.c
+++ b/coders/yuv.c
@@ -633,6 +633,7 @@
size_t
height,
+ imageListLength,
quantum,
width;
@@ -692,6 +693,7 @@
return(status);
}
scene=0;
+ imageListLength=GetImageListLength(image);
do
{
/*
@@ -882,8 +884,7 @@
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
- status=SetImageProgress(image,SaveImagesTag,scene++,
- GetImageListLength(image));
+ status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);