]> git.imager.perl.org - imager.git/blobdiff - tga.c
fix method index entry for add_file_magic()
[imager.git] / tga.c
diff --git a/tga.c b/tga.c
index fcfdb8785347c37d29a981dde86eed74b95c2b57..8ee635a9121d73a19947c43d087b77ba9b469cb8 100644 (file)
--- a/tga.c
+++ b/tga.c
@@ -559,7 +559,7 @@ tga_palette_read(io_glue *ig, i_img *img, int bytepp, int colourmaplength) {
   palbuf   = mymalloc(palbsize);
   
   if (i_io_read(ig, palbuf, palbsize) != palbsize) {
-    i_push_error(errno, "could not read targa colourmap");
+    i_push_error(errno, "could not read targa colormap");
     return 0;
   }
   
@@ -601,7 +601,7 @@ tga_palette_write(io_glue *ig, i_img *img, int bitspp, int colourmaplength) {
   }
   
   if (i_io_write(ig, palbuf, palbsize) != palbsize) {
-    i_push_error(errno, "could not write targa colourmap");
+    i_push_error(errno, "could not write targa colormap");
     return 0;
   }
   myfree(palbuf);
@@ -723,8 +723,8 @@ i_readtga_wiol(io_glue *ig, int length) {
   
   mapped = 1;
   switch (header.datatypecode) {
-  case 2:  /* Uncompressed, rgb images          */
-  case 10: /* Compressed,   rgb images          */
+  case 2:  /* Uncompressed, rgb images          */ /* FALLTHROUGH */
+  case 10: /* Compressed,   rgb images          */ /* FALLTHROUGH */
     mapped = 0;
   case 1:  /* Uncompressed, color-mapped images */
   case 9:  /* Compressed,   color-mapped images */
@@ -736,7 +736,7 @@ i_readtga_wiol(io_glue *ig, int length) {
     if (idstring) myfree(idstring);
     return NULL;
     break;
-  case 3:  /* Uncompressed, grayscale images    */
+  case 3:  /* Uncompressed, grayscale images    */ /* FALLTHROUGH */
   case 11: /* Compressed,   grayscale images    */
     mapped = 0;
     channels = 1;
@@ -773,8 +773,7 @@ i_readtga_wiol(io_glue *ig, int length) {
                        bpp_to_bytes(header.colourmapdepth),
                        header.colourmaplength)
       ) {
-    i_push_error(0, "Targa Image has none of 15/16/24/32 pixel layout");
-    if (idstring) myfree(idstring);
+    /* tga_palette_read() sets a message */
     if (img) i_img_destroy(img);
     return NULL;
   }