diff --git a/coders/rgf.c b/coders/rgf.c
index caf232e..ec124e4 100644
--- a/coders/rgf.c
+++ b/coders/rgf.c
@@ -350,8 +350,8 @@
   /*
     Write header (just the image dimensions)
    */
-  (void)WriteBlobByte(image,image->rows & 0xff);
-  (void)WriteBlobByte(image,image->columns & 0xff);
+  (void) WriteBlobByte(image,image->columns & 0xff);
+  (void) WriteBlobByte(image,image->rows & 0xff);
 
   /*
     Convert MIFF to bit pixels.