]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 3 Jun 2010 16:24:13 +0000 (16:24 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 3 Jun 2010 16:24:13 +0000 (16:24 +0000)
Magick++/lib/Image.cpp
Magick++/lib/Magick++/Geometry.h
Magick++/lib/Magick++/Image.h
Magick++/lib/Magick++/STL.h
coders/icon.c
coders/palm.c
coders/png.c

index 089bda66a2562d5d705ca1ccd4bd80c88fb906ef..b3f3f68e33a1cb5df933bd9451c7bf6e2636b575 100644 (file)
@@ -928,8 +928,8 @@ void Magick::Image::flip ( void )
 // Flood-fill color across pixels that match the color of the
 // target pixel and are neighbors of the target pixel.
 // Uses current fuzz setting when determining color match.
-void Magick::Image::floodFillColor( const size_t x_,
-                                    const size_t y_,
+void Magick::Image::floodFillColor( const ssize_t x_,
+                                    const ssize_t y_,
                                    const Magick::Color &fillColor_ )
 {
   floodFillTexture( x_, y_, Image( Geometry( 1, 1), fillColor_ ) );
@@ -943,8 +943,8 @@ void Magick::Image::floodFillColor( const Geometry &point_,
 // Flood-fill color across pixels starting at target-pixel and
 // stopping at pixels matching specified border color.
 // Uses current fuzz setting when determining color match.
-void Magick::Image::floodFillColor( const size_t x_,
-                                    const size_t y_,
+void Magick::Image::floodFillColor( const ssize_t x_,
+                                    const ssize_t y_,
                                    const Magick::Color &fillColor_,
                                    const Magick::Color &borderColor_ )
 {
@@ -961,9 +961,9 @@ void Magick::Image::floodFillColor( const Geometry &point_,
 
 // Floodfill pixels matching color (within fuzz factor) of target
 // pixel(x,y) with replacement opacity value using method.
-void Magick::Image::floodFillOpacity( const size_t x_,
-                                      const size_t y_,
-                                      const size_t opacity_,
+void Magick::Image::floodFillOpacity( const ssize_t x_,
+                                      const ssize_t y_,
+                                      const unsigned int opacity_,
                                       const PaintMethod method_ )
 {
   modifyImage();
@@ -986,8 +986,8 @@ void Magick::Image::floodFillOpacity( const size_t x_,
 // Flood-fill texture across pixels that match the color of the
 // target pixel and are neighbors of the target pixel.
 // Uses current fuzz setting when determining color match.
-void Magick::Image::floodFillTexture( const size_t x_,
-                                      const size_t y_,
+void Magick::Image::floodFillTexture( const ssize_t x_,
+                                      const ssize_t y_,
                                      const Magick::Image &texture_ )
 {
   modifyImage();
@@ -1025,8 +1025,8 @@ void Magick::Image::floodFillTexture( const Magick::Geometry &point_,
 // Flood-fill texture across pixels starting at target-pixel and
 // stopping at pixels matching specified border color.
 // Uses current fuzz setting when determining color match.
-void Magick::Image::floodFillTexture( const size_t x_,
-                                      const size_t y_,
+void Magick::Image::floodFillTexture( const ssize_t x_,
+                                      const ssize_t y_,
                                      const Magick::Image &texture_,
                                      const Magick::Color &borderColor_ )
 {
@@ -1318,7 +1318,7 @@ void Magick::Image::map ( const Image &mapImage_ , const bool dither_ )
 }
 // Floodfill designated area with replacement opacity value
 void Magick::Image::matteFloodfill ( const Color &target_ ,
-                                    const size_t opacity_,
+                                    const unsigned int opacity_,
                                     const ssize_t x_, const ssize_t y_,
                                     const Magick::PaintMethod method_ )
 {
@@ -1427,7 +1427,7 @@ void Magick::Image::oilPaint ( const double radius_ )
 // opacity_ ranges from 0 (completely opaque) to QuantumRange. The defines
 // OpaqueOpacity and TransparentOpacity are available to specify
 // completely opaque or completely transparent, respectively.
-void Magick::Image::opacity ( const size_t opacity_ )
+void Magick::Image::opacity ( const unsigned int opacity_ )
 {
   modifyImage();
   SetImageOpacity( image(), opacity_ );
@@ -2871,8 +2871,8 @@ Magick::Geometry Magick::Image::density ( void ) const
 {
   if (isValid())
     {
-      size_t x_resolution=72;
-      size_t y_resolution=72;
+      ssize_t x_resolution=72;
+      ssize_t y_resolution=72;
 
       if (constImage()->x_resolution > 0.0)
         x_resolution=static_cast<size_t>(constImage()->x_resolution + 0.5);
@@ -3388,7 +3388,7 @@ Magick::Image  Magick::Image::penTexture ( void  ) const
 }
 
 // Set the color of a pixel.
-void Magick::Image::pixelColor ( const size_t x_, const size_t y_,
+void Magick::Image::pixelColor ( const ssize_t x_, const ssize_t y_,
                                 const Color &color_ )
 {
   // Test arguments to ensure they are within the image.
@@ -3412,8 +3412,8 @@ void Magick::Image::pixelColor ( const size_t x_, const size_t y_,
 }
 
 // Get the color of a pixel
-Magick::Color Magick::Image::pixelColor ( const size_t x_,
-                                         const size_t y_ ) const
+Magick::Color Magick::Image::pixelColor ( const ssize_t x_,
+                                         const ssize_t y_ ) const
 {
   ClassType storage_class;
   storage_class = classType();
index f8d0015a37e5a907c7410db8590a733e16d674dd..817f322e6b14914873d80381789914f80b0596cc 100644 (file)
@@ -109,8 +109,8 @@ namespace Magick
   private:
     size_t  _width;
     size_t  _height;
-    size_t  _xOff;
-    size_t  _yOff;
+    ssize_t  _xOff;
+    ssize_t  _yOff;
     bool          _xNegative;
     bool          _yNegative;
     bool          _isValid;
index 3dd5d2dbf9732bd2f94ea81539cc7a861fd7ce4b..ce271b5f3ce4c2bc48cce9b46256788fbe91321e 100644 (file)
@@ -314,8 +314,8 @@ namespace Magick
     // Flood-fill color across pixels that match the color of the
     // target pixel and are neighbors of the target pixel.
     // Uses current fuzz setting when determining color match.
-    void            floodFillColor( const size_t x_,
-                                    const size_t y_,
+    void            floodFillColor( const ssize_t x_,
+                                    const ssize_t y_,
             const Color &fillColor_ );
     void            floodFillColor( const Geometry &point_,
             const Color &fillColor_ );
@@ -323,8 +323,8 @@ namespace Magick
     // Flood-fill color across pixels starting at target-pixel and
     // stopping at pixels matching specified border color.
     // Uses current fuzz setting when determining color match.
-    void            floodFillColor( const size_t x_,
-                                    const size_t y_,
+    void            floodFillColor( const ssize_t x_,
+                                    const ssize_t y_,
             const Color &fillColor_,
             const Color &borderColor_ );
     void            floodFillColor( const Geometry &point_,
@@ -333,16 +333,16 @@ namespace Magick
 
     // Floodfill pixels matching color (within fuzz factor) of target
     // pixel(x,y) with replacement opacity value using method.
-    void            floodFillOpacity ( const size_t x_,
-                                       const size_t y_,
-                                       const size_t opacity_,
+    void            floodFillOpacity ( const ssize_t x_,
+                                       const ssize_t y_,
+                                       const unsigned int opacity_,
                                        const PaintMethod method_ );
 
     // Flood-fill texture across pixels that match the color of the
     // target pixel and are neighbors of the target pixel.
     // Uses current fuzz setting when determining color match.
-    void            floodFillTexture( const size_t x_,
-                                      const size_t y_,
+    void            floodFillTexture( const ssize_t x_,
+                                      const ssize_t y_,
               const Image &texture_ );
     void            floodFillTexture( const Geometry &point_,
               const Image &texture_ );
@@ -350,8 +350,8 @@ namespace Magick
     // Flood-fill texture across pixels starting at target-pixel and
     // stopping at pixels matching specified border color.
     // Uses current fuzz setting when determining color match.
-    void            floodFillTexture( const size_t x_,
-                                      const size_t y_,
+    void            floodFillTexture( const ssize_t x_,
+                                      const ssize_t y_,
               const Image &texture_,
               const Color &borderColor_ );
     void            floodFillTexture( const Geometry &point_,
@@ -449,7 +449,7 @@ namespace Magick
     
     // Floodfill designated area with replacement opacity value
     void            matteFloodfill ( const Color &target_ ,
-             const size_t opacity_,
+             const unsigned int opacity_,
              const ssize_t x_, const ssize_t y_,
              const PaintMethod method_ );
 
@@ -493,7 +493,7 @@ namespace Magick
     // to QuantumRange. The defines OpaqueOpacity and TransparentOpacity are
     // available to specify completely opaque or completely
     // transparent, respectively.
-    void            opacity ( const size_t opacity_ );
+    void            opacity ( const unsigned int opacity_ );
 
     // Change color of opaque pixel to specified pen color.
     void            opaque ( const Color &opaqueColor_,
@@ -1085,11 +1085,11 @@ typedef struct _ImageStatistics
     Image           penTexture ( void  ) const;
 
     // Get/set pixel color at location x & y.
-    void            pixelColor ( const size_t x_,
-                                 const size_t y_,
+    void            pixelColor ( const ssize_t x_,
+                                 const ssize_t y_,
          const Color &color_ );
-    Color           pixelColor ( const size_t x_,
-                                 const size_t y_ ) const;
+    Color           pixelColor ( const ssize_t x_,
+                                 const ssize_t y_ ) const;
 
     // Add or remove a named profile to/from the image. Remove the
     // profile by passing an empty Blob (e.g. Blob()). Valid names are
index ca385c57d803cf3cb5b601994d944fb7962849cf..2b9317c8df9ed5806a4b91fe34db7b4668055c92 100644 (file)
@@ -71,7 +71,7 @@ namespace Magick
   private:
     size_t _width;
     size_t _height;
-    size_t _offset;
+    ssize_t _offset;
   };
   
   // Add noise to image with specified noise type
@@ -228,9 +228,9 @@ namespace Magick
     void operator()( Image &image_ ) const;
 
   private:
-    size_t _opacityRed;
-    size_t _opacityGreen;
-    size_t _opacityBlue;
+    unsigned int _opacityRed;
+    unsigned int _opacityGreen;
+    unsigned int _opacityBlue;
     Color _penColor;
   };
 
@@ -904,8 +904,8 @@ namespace Magick
     void operator()( Image &image_ ) const;
 
   private:
-    ssize_t _columns;
-    ssize_t _rows;
+    size_t _columns;
+    size_t _rows;
   };
 
   // Rotate image counter-clockwise by specified number of degrees.
index b37afa511f0189fd061e5496aba27977b30c2d4f..298ec2f1e6a0dcaec4d810193d1bd900191ceec5 100644 (file)
@@ -902,6 +902,9 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
           }
         else
           {
+            size_t
+              one;
+
             /*
               Colormapped ICON raster.
             */
@@ -912,7 +915,8 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
               icon_info.bits_per_pixel=4;
             if (next->colors <= 2)
               icon_info.bits_per_pixel=1;
-            icon_info.number_colors=1 << icon_info.bits_per_pixel;
+            one=1;
+            icon_info.number_colors=one << icon_info.bits_per_pixel;
             if (icon_info.number_colors < next->colors)
               {
                 (void) SetImageStorageClass(next,DirectClass);
@@ -1126,17 +1130,17 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
         icon_file.directory[scene].bits_per_pixel=icon_info.bits_per_pixel;
         icon_file.directory[scene].size=icon_info.size;
         icon_file.directory[scene].offset=(size_t) TellBlob(image);
-        (void) WriteBlobLSBLong(image,(size_t) 40);
-        (void) WriteBlobLSBLong(image,(size_t) icon_info.width);
-        (void) WriteBlobLSBLong(image,(size_t) icon_info.height*2);
+        (void) WriteBlobLSBLong(image,(unsigned int) 40);
+        (void) WriteBlobLSBLong(image,(unsigned int) icon_info.width);
+        (void) WriteBlobLSBLong(image,(unsigned int) icon_info.height*2);
         (void) WriteBlobLSBShort(image,icon_info.planes);
         (void) WriteBlobLSBShort(image,icon_info.bits_per_pixel);
-        (void) WriteBlobLSBLong(image,icon_info.compression);
-        (void) WriteBlobLSBLong(image,icon_info.image_size);
-        (void) WriteBlobLSBLong(image,icon_info.x_pixels);
-        (void) WriteBlobLSBLong(image,icon_info.y_pixels);
-        (void) WriteBlobLSBLong(image,icon_info.number_colors);
-        (void) WriteBlobLSBLong(image,icon_info.colors_important);
+        (void) WriteBlobLSBLong(image,(unsigned int) icon_info.compression);
+        (void) WriteBlobLSBLong(image,(unsigned int) icon_info.image_size);
+        (void) WriteBlobLSBLong(image,(unsigned int) icon_info.x_pixels);
+        (void) WriteBlobLSBLong(image,(unsigned int) icon_info.y_pixels);
+        (void) WriteBlobLSBLong(image,(unsigned int) icon_info.number_colors);
+        (void) WriteBlobLSBLong(image,(unsigned int) icon_info.colors_important);
         if (next->storage_class == PseudoClass)
           {
             unsigned char
index 15b920c69949fce5f4573ebb265de34b6950f2d7..d73d1d943cade704dd3aa79c6f0d24ff1d8bf2dc 100644 (file)
@@ -227,7 +227,7 @@ static int FindColor(PixelPacket *pixel)
 %
 */
 
-static inline ssize_t MagickMax(const ssize_t x,const ssize_t y)
+static inline size_t MagickMax(const size_t x,const size_t y)
 {
   if (x > y)
     return(x);
index 6e25765517a3b185d13605e3a902feef87f2a338..f0f8e3eb75d7e75ea6d045aeb3c4641ef4f296da 100644 (file)
@@ -387,7 +387,7 @@ typedef struct _MngInfo
   RenderingIntent
     global_srgb_intent;
 
-  size_t
+  unsigned int
     delay,
     global_plte_length,
     global_trns_length,
@@ -2199,11 +2199,14 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
       int
         max_sample;
 
+      size_t
+        one=1;
+
       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "    Reading PNG tRNS chunk.");
 
-      max_sample = (1 << ping_bit_depth) - 1;
+      max_sample = (one << ping_bit_depth) - 1;
 
       if ((ping_color_type == PNG_COLOR_TYPE_GRAY &&
           (int)ping_trans_color->gray > max_sample) ||
@@ -4352,7 +4355,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
                   mng_info->global_plte[i].green=p[3*i+1];
                   mng_info->global_plte[i].blue=p[3*i+2];
                 }
-                mng_info->global_plte_length=length/3;
+                mng_info->global_plte_length=(unsigned int) (length/3);
               }
 #ifdef MNG_LOOSE
             for ( ; i < 256; i++)
@@ -4381,7 +4384,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
             for ( ; i < 256; i++)
               mng_info->global_trns[i]=255;
 #endif
-            mng_info->global_trns_length=length;
+            mng_info->global_trns_length=(usnigned int) length;
             chunk=(unsigned char *) RelinquishMagickMemory(chunk);
             continue;
           }
@@ -6877,8 +6880,9 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
         }
       if (ping_color_type == PNG_COLOR_TYPE_PALETTE)
         {
+           size_t one = 1;
            ping_bit_depth=1;
-           while ((int) (1 << ping_bit_depth) < (ssize_t) image_colors)
+           while ((int) (one << ping_bit_depth) < (ssize_t) image_colors)
              ping_bit_depth <<= 1;
 
            if (logging != MagickFalse)
@@ -7056,6 +7060,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
         mng_info->write_png_colortype-1 != PNG_COLOR_TYPE_PALETTE &&
         ImageIsGray(image) && (!image_matte || image_depth >= 8))
       {
+        size_t one=1;
         if (image_matte != MagickFalse)
             ping_color_type=PNG_COLOR_TYPE_GRAY_ALPHA;
         else
@@ -7067,7 +7072,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
         if (image_depth > MAGICKCORE_QUANTUM_DEPTH)
           image_depth=MAGICKCORE_QUANTUM_DEPTH;
         if (image_colors == 0 || image_colors-1 > MaxColormapSize)
-          image_colors=1 << image_depth;
+          image_colors=one << image_depth;
         if (image_depth > 8)
           ping_bit_depth=16;
         else
@@ -7078,7 +7083,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
                 if(!mng_info->write_png_depth)
                   {
                     ping_bit_depth=1;
-                    while ((int) (1 << ping_bit_depth)
+                    while ((int) (one << ping_bit_depth)
                         < (ssize_t) image_colors)
                       ping_bit_depth <<= 1;
                   }
@@ -7293,7 +7298,10 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
          png_color_16
            background;
 
-         maxval=(png_uint_16) ((1 << ping_bit_depth)-1);
+         size_t
+           one=1;
+
+         maxval=(png_uint_16) ((ine << ping_bit_depth)-1);
 
 
          background.gray=(png_uint_16)
@@ -8496,7 +8504,7 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info,
           (void) WriteBlobMSBULong(image,4L);
           PNGType(chunk,mng_gAMA);
           LogPNGChunk((int) logging,mng_gAMA,4L);
-          PNGLong(chunk+4,(size_t) (100000*image->gamma+0.5));
+          PNGLong(chunk+4,(png_uint_32) (100000*image->gamma+0.5));
           (void) WriteBlob(image,8,chunk);
           (void) WriteBlobMSBULong(image,crc32(0,chunk,8));
         }
@@ -8513,17 +8521,17 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info,
           PNGType(chunk,mng_cHRM);
           LogPNGChunk((int) logging,mng_cHRM,32L);
           primary=image->chromaticity.white_point;
-          PNGLong(chunk+4,(size_t) (100000*primary.x+0.5));
-          PNGLong(chunk+8,(size_t) (100000*primary.y+0.5));
+          PNGLong(chunk+4,(png_uint_32) (100000*primary.x+0.5));
+          PNGLong(chunk+8,(png_uint_32) (100000*primary.y+0.5));
           primary=image->chromaticity.red_primary;
-          PNGLong(chunk+12,(size_t) (100000*primary.x+0.5));
-          PNGLong(chunk+16,(size_t) (100000*primary.y+0.5));
+          PNGLong(chunk+12,(png_uint_32) (100000*primary.x+0.5));
+          PNGLong(chunk+16,(png_uint_32) (100000*primary.y+0.5));
           primary=image->chromaticity.green_primary;
-          PNGLong(chunk+20,(size_t) (100000*primary.x+0.5));
-          PNGLong(chunk+24,(size_t) (100000*primary.y+0.5));
+          PNGLong(chunk+20,(png_uint_32) (100000*primary.x+0.5));
+          PNGLong(chunk+24,(png_uint_32) (100000*primary.y+0.5));
           primary=image->chromaticity.blue_primary;
-          PNGLong(chunk+28,(size_t) (100000*primary.x+0.5));
-          PNGLong(chunk+32,(size_t) (100000*primary.y+0.5));
+          PNGLong(chunk+28,(png_uint_32) (100000*primary.x+0.5));
+          PNGLong(chunk+32,(png_uint_32) (100000*primary.y+0.5));
           (void) WriteBlob(image,36,chunk);
           (void) WriteBlobMSBULong(image,crc32(0,chunk,36));
         }
@@ -8538,9 +8546,9 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info,
       LogPNGChunk((int) logging,mng_pHYs,9L);
       if (image->units == PixelsPerInchResolution)
         {
-          PNGLong(chunk+4,(size_t)
+          PNGLong(chunk+4,(png_uint_32)
             (image->x_resolution*100.0/2.54+0.5));
-          PNGLong(chunk+8,(size_t)
+          PNGLong(chunk+8,(png_uint_32)
             (image->y_resolution*100.0/2.54+0.5));
           chunk[12]=1;
         }
@@ -8548,16 +8556,16 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info,
         {
           if (image->units == PixelsPerCentimeterResolution)
             {
-              PNGLong(chunk+4,(size_t)
+              PNGLong(chunk+4,(png_uint_32)
                 (image->x_resolution*100.0+0.5));
-              PNGLong(chunk+8,(size_t)
+              PNGLong(chunk+8,(png_uint_32)
                 (image->y_resolution*100.0+0.5));
               chunk[12]=1;
             }
           else
             {
-              PNGLong(chunk+4,(size_t) (image->x_resolution+0.5));
-              PNGLong(chunk+8,(size_t) (image->y_resolution+0.5));
+              PNGLong(chunk+4,(png_uint_32) (image->x_resolution+0.5));
+              PNGLong(chunk+8,(png_uint_32) (image->y_resolution+0.5));
               chunk[12]=0;
             }
         }
@@ -9337,7 +9345,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image)
              (void) WriteBlobMSBULong(image,4L);
              PNGType(chunk,mng_gAMA);
              LogPNGChunk((int) logging,mng_gAMA,4L);
-             PNGLong(chunk+4,(size_t) (100000*image->gamma+0.5));
+             PNGLong(chunk+4,(png_uint_32) (100000*image->gamma+0.5));
              (void) WriteBlob(image,8,chunk);
              (void) WriteBlobMSBULong(image,crc32(0,chunk,8));
              mng_info->have_write_global_gama=MagickTrue;
@@ -9354,17 +9362,17 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image)
              PNGType(chunk,mng_cHRM);
              LogPNGChunk((int) logging,mng_cHRM,32L);
              primary=image->chromaticity.white_point;
-             PNGLong(chunk+4,(size_t) (100000*primary.x+0.5));
-             PNGLong(chunk+8,(size_t) (100000*primary.y+0.5));
+             PNGLong(chunk+4,(png_uint_32) (100000*primary.x+0.5));
+             PNGLong(chunk+8,(png_uint_32) (100000*primary.y+0.5));
              primary=image->chromaticity.red_primary;
-             PNGLong(chunk+12,(size_t) (100000*primary.x+0.5));
-             PNGLong(chunk+16,(size_t) (100000*primary.y+0.5));
+             PNGLong(chunk+12,(png_uint_32) (100000*primary.x+0.5));
+             PNGLong(chunk+16,(png_uint_32) (100000*primary.y+0.5));
              primary=image->chromaticity.green_primary;
-             PNGLong(chunk+20,(size_t) (100000*primary.x+0.5));
-             PNGLong(chunk+24,(size_t) (100000*primary.y+0.5));
+             PNGLong(chunk+20,(png_uint_32) (100000*primary.x+0.5));
+             PNGLong(chunk+24,(png_uint_32) (100000*primary.y+0.5));
              primary=image->chromaticity.blue_primary;
-             PNGLong(chunk+28,(size_t) (100000*primary.x+0.5));
-             PNGLong(chunk+32,(size_t) (100000*primary.y+0.5));
+             PNGLong(chunk+28,(png_uint_32) (100000*primary.x+0.5));
+             PNGLong(chunk+32,(png_uint_32) (100000*primary.y+0.5));
              (void) WriteBlob(image,36,chunk);
              (void) WriteBlobMSBULong(image,crc32(0,chunk,36));
              mng_info->have_write_global_chrm=MagickTrue;
@@ -9380,9 +9388,9 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image)
          LogPNGChunk((int) logging,mng_pHYs,9L);
          if (image->units == PixelsPerInchResolution)
            {
-             PNGLong(chunk+4,(size_t)
+             PNGLong(chunk+4,(png_uint_32)
                (image->x_resolution*100.0/2.54+0.5));
-             PNGLong(chunk+8,(size_t)
+             PNGLong(chunk+8,(png_uint_32)
                (image->y_resolution*100.0/2.54+0.5));
              chunk[12]=1;
            }
@@ -9390,16 +9398,16 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image)
            {
              if (image->units == PixelsPerCentimeterResolution)
                {
-                 PNGLong(chunk+4,(size_t)
+                 PNGLong(chunk+4,(png_uint_32)
                    (image->x_resolution*100.0+0.5));
-                 PNGLong(chunk+8,(size_t)
+                 PNGLong(chunk+8,(png_uint_32)
                    (image->y_resolution*100.0+0.5));
                  chunk[12]=1;
                }
              else
                {
-                 PNGLong(chunk+4,(size_t) (image->x_resolution+0.5));
-                 PNGLong(chunk+8,(size_t) (image->y_resolution+0.5));
+                 PNGLong(chunk+4,(png_uint_32) (image->x_resolution+0.5));
+                 PNGLong(chunk+8,(png_uint_32) (image->y_resolution+0.5));
                  chunk[12]=0;
                }
            }