Index: trunk/Ohana/src/opihi/cmd.data/jpeg.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/jpeg.c	(revision 3693)
+++ trunk/Ohana/src/opihi/cmd.data/jpeg.c	(revision 5846)
@@ -46,14 +46,13 @@
     if (!filename[0]) strcpy (filename, "Ximage.jpg");
     strcpy (type, "JPEG");
+    KiiJpeg (Source, filename);
   } else {
     if (!GetGraph (NULL, &Source, &Nsource)) return (FALSE);
     if (!filename[0]) strcpy (filename, "Xgraph.png");
+    SendGraphCommand (Source, 4, type);
+    SendGraphCommand (Source, 16, "LEN: %11d", strlen(filename));
+    write (Source, filename, strlen(filename));
+    read (Source, buffer, 4);
   }
-
-  SendGraphCommand (Source, 4, type);
-  SendGraphCommand (Source, 16, "LEN: %11d", strlen(filename));
-  write (Source, filename, strlen(filename));
-  read (Source, buffer, 4);
-
   return (TRUE);
 }
