]> git.imager.perl.org - imager.git/blobdiff - rgb.c
more to do
[imager.git] / rgb.c
diff --git a/rgb.c b/rgb.c
index b264c5a62400b071e16d08b2353ee881ad0c99c3..7559a06ceea83fef81192134219d35d1255b2d84 100644 (file)
--- a/rgb.c
+++ b/rgb.c
@@ -1,5 +1,4 @@
 #include "image.h"
-#include "io.h"
 #include "log.h"
 #include "iolayer.h"
 
@@ -170,18 +169,15 @@ Returns NULL on error.
 i_img *
 i_readrgb_wiol(io_glue *ig, int length) {
   i_img *img;
-  int x, y, c,i;
+  int y, c,i;
   int width, height, channels;
   unsigned long maxlen;
 
   int savemask;
   
-  char *idstring = NULL;
-
   rgb_header header;
   unsigned char headbuf[512];
   unsigned char *databuf;
-  unsigned char *reorderbuf;
   unsigned long *starttab, *lengthtab;
   i_color *linebuf = NULL;
   i_mempool mp;
@@ -227,9 +223,11 @@ i_readrgb_wiol(io_glue *ig, int length) {
   channels = header.zsize;
 
   img = i_img_empty_ch(NULL, width, height, channels);
+  if (!img)
+    return NULL;
   
   i_tags_add(&img->tags, "rgb_namestr", 0, header.name, 80, 0);
-
+  i_tags_add(&img->tags, "i_format", 0, "rgb", -1, 0);
 
   switch (header.storagetype) {
   case 0: /* uncompressed */
@@ -344,6 +342,8 @@ i_readrgb_wiol(io_glue *ig, int length) {
     break;
   }
 
+  i_tags_add(&img->tags, "i_format", 0, "rgb", -1, 0);
+
   i_mempool_destroy(&mp);
   return img;
 
@@ -368,9 +368,9 @@ Writes an image in targa format.  Returns 0 on error.
 
 undef_int
 i_writergb_wiol(i_img *img, io_glue *ig, int wierdpack, int compress, char *idstring, size_t idlen) {
-  
-
-
+  i_clear_error();
+  i_push_error(0, "writing SGI RGB files is not implemented");
 
+  return 0;
 }