EV3 RGF support in ImageMagick

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
bdwheele
Posts: 3
Joined: 04 Jun 2013, 17:16

EV3 RGF support in ImageMagick

Post by bdwheele »

Just as an FYI, I submitted a patch to ImageMagick to support the EV3 RGF file format. It should appear in the next release, but for now, you can grab the source from: http://imagemagick.org/script/subversion.php

Versions > 13159 support RGF with widths divisible by 8, and I submitted a patch this morning to support any width. The patch for that (against) version 13175 is:

Code: Select all

Index: coders/rgf.c
===================================================================
--- coders/rgf.c    (revision 13175)
+++ coders/rgf.c    (working copy)
@@ -357,8 +357,6 @@
     Convert MIFF to bit pixels.
   */
   (void) SetImageType(image,BilevelType,exception);
-  bit=0;
-  byte=0;
   x=0;
   y=0;
   for (y=0; y < (ssize_t) image->rows; y++)
@@ -366,6 +364,8 @@
p=GetVirtualPixels(image,0,y,image->columns,1,exception);
     if (p == (const Quantum *) NULL)
       break;
+    byte = 0;
+    bit = 0;
     for (x=0; x < (ssize_t) image->columns; x++)
     {
       byte>>=1;
@@ -382,6 +382,10 @@
           byte=0;
         }
         p+=GetPixelChannels(image);
+    }
+    if(bit != 0)
+      {
+    (void) WriteBlobByte(image, byte);
       }
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
       image->rows);
if you want to use it before it is submitted to the trunk.

I found out that if the images are not exactly what the EV3 software is looking for, it will crash it. Anyone know of a contact to inform them of that bug?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest