function checkHeader( header )
   {
      // What the need of a file without data ?
      if (header.imageType === Targa.Type.NO_DATA) {
         throw new Error('Targa::checkHeader() - No data');
      }

      // Indexed type
      if (header.hasColorMap) {
         if (header.colorMapLength > 256 || header.colorMapSize !== 24 || header.colorMapType !== 1) {
            throw new Error('Targa::checkHeader() - Invalid colormap for indexed type');
         }
      }
      else {
         if (header.colorMapType) {
            throw new Error('Targa::checkHeader() - Why does the image contain a palette ?');
         }
      }

      // Check image size
      if (header.width <= 0 || header.height <= 0) {
         throw new Error('Targa::checkHeader() - Invalid image size');
      }

      // Check pixel size
      if (header.pixelDepth !== 8  &&
          header.pixelDepth !== 16 &&
          header.pixelDepth !== 24 &&
          header.pixelDepth !== 32) {
         throw new Error('Targa::checkHeader() - Invalid pixel size "' + header.pixelDepth + '"');
      }
   }
Check the header of TGA file to detect errors

@param {object} tga header structure
@throws Error