#include "magick/blob.h"
#include "magick/blob-private.h"
#include "magick/cache.h"
+#include "magick/colormap.h"
#include "magick/constitute.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
%
*/
-static inline unsigned long MagickMin(const unsigned long x,
- const unsigned long y)
+static inline size_t MagickMin(const size_t x,
+ const size_t y)
{
if (x < y)
return(x);
static Image *ReadSTEGANOImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
-#define GetBit(alpha,i) MagickMin((((unsigned long) (alpha) >> (unsigned long) \
+#define GetBit(alpha,i) MagickMin((((size_t) (alpha) >> (size_t) \
(i)) & 0x01),16)
#define SetBit(alpha,i,set) (alpha)=(IndexPacket) ((set) != 0 ? \
- (unsigned long) (alpha) | (1UL << (unsigned long) (i)) : (unsigned long) \
- (alpha) & ~(1UL << (unsigned long) (i)))
+ (size_t) (alpha) | (one << (size_t) (i)) : (size_t) \
+ (alpha) & ~(one << (size_t) (i)))
Image
*image,
ImageInfo
*read_info;
- long
- c,
- i,
- j,
- k,
- y;
+ int
+ c;
MagickBooleanType
status;
register IndexPacket
*indexes;
- register long
- x;
-
register PixelPacket
*q;
- unsigned long
- depth;
+ register ssize_t
+ x;
+
+ size_t
+ depth,
+ one;
+
+ ssize_t
+ i,
+ j,
+ k,
+ y;
/*
Initialize Image structure.
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
+ one=1;
image=AcquireImage(image_info);
if ((image->columns == 0) || (image->rows == 0))
ThrowReaderException(OptionError,"MustSpecifyImageSize");
c=0;
i=0;
j=0;
- i=MAGICKCORE_QUANTUM_DEPTH-1;
- depth=MAGICKCORE_QUANTUM_DEPTH;
- for (k=image->offset; (i >= 0) && (j < (long) depth); i--)
+ i=(ssize_t) (watermark->depth-1);
+ depth=watermark->depth;
+ for (k=image->offset; (i >= 0) && (j < (ssize_t) depth); i--)
{
- for (y=0; (y < (long) image->rows) && (j < (long) depth); y++)
+ for (y=0; (y < (ssize_t) image->rows) && (j < (ssize_t) depth); y++)
{
x=0;
- for (; (x < (long) image->columns) && (j < (long) depth); x++)
+ for ( ; (x < (ssize_t) image->columns) && (j < (ssize_t) depth); x++)
{
- if ((k/(long) watermark->columns) >= (long) watermark->rows)
+ if ((k/(ssize_t) watermark->columns) >= (ssize_t) watermark->rows)
break;
- (void) GetOneVirtualPixel(watermark,k % (long) watermark->columns,
- k/(long) watermark->columns,&pixel,exception);
+ (void) GetOneVirtualPixel(watermark,k % (ssize_t) watermark->columns,
+ k/(ssize_t) watermark->columns,&pixel,exception);
q=GetAuthenticPixels(image,x,y,1,1,exception);
if (q == (PixelPacket *) NULL)
break;
if (c == 3)
c=0;
k++;
- if (k == (long) (watermark->columns*watermark->columns))
+ if (k == (ssize_t) (watermark->columns*watermark->columns))
k=0;
if (k == image->offset)
j++;
}
}
- status=SetImageProgress(image,LoadImagesTag,i,depth);
+ status=SetImageProgress(image,LoadImagesTag,(MagickOffsetType) i,depth);
if (status == MagickFalse)
break;
}
%
% The format of the RegisterSTEGANOImage method is:
%
-% unsigned long RegisterSTEGANOImage(void)
+% size_t RegisterSTEGANOImage(void)
%
*/
-ModuleExport unsigned long RegisterSTEGANOImage(void)
+ModuleExport size_t RegisterSTEGANOImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("STEGANO");
entry->decoder=(DecodeImageHandler *) ReadSTEGANOImage;
- entry->format_type=ExplicitFormatType;
+ entry->format_type=ImplicitFormatType;
entry->description=ConstantString("Steganographic image");
entry->module=ConstantString("STEGANO");
(void) RegisterMagickInfo(entry);