Added more specific non-supported compression algorithms

message.
This commit is contained in:
2016-09-10 01:49:17 +01:00
parent 3c520c3216
commit 11b6c094c6
2 changed files with 30 additions and 7 deletions

View File

@@ -335,10 +335,20 @@ namespace DiscImageChef.DiscImages
bChnk.sector += (uint)ImageInfo.sectors; bChnk.sector += (uint)ImageInfo.sectors;
// TODO: Handle compressed chunks // TODO: Handle compressed chunks
if((bChnk.type & ChunkType_CompressedMask) == ChunkType_CompressedMask) if((bChnk.type == ChunkType_KenCode))
throw new ImageNotSupportedException("Compressed chunks are not yet supported."); throw new ImageNotSupportedException("Chunks compressed with KenCode are not yet supported.");
if((bChnk.type == ChunkType_RLE))
throw new ImageNotSupportedException("Chunks compressed with RLE are not yet supported.");
if((bChnk.type == ChunkType_LZH))
throw new ImageNotSupportedException("Chunks compressed with LZH are not yet supported.");
if((bChnk.type == ChunkType_ADC))
throw new ImageNotSupportedException("Chunks compressed with ADC are not yet supported.");
if(bChnk.type != ChunkType_Copy && bChnk.type != ChunkType_NoCopy) // TODO: Handle compressed chunks
if((bChnk.type > ChunkType_Copy && bChnk.type < ChunkType_KenCode) ||
(bChnk.type > ChunkType_ADC && bChnk.type < ChunkType_StuffIt) ||
(bChnk.type > ChunkType_StuffIt && bChnk.type < ChunkType_End) ||
bChnk.type == 1)
throw new ImageNotSupportedException(string.Format("Unsupported chunk type 0x{0:X8} found", bChnk.type)); throw new ImageNotSupportedException(string.Format("Unsupported chunk type 0x{0:X8} found", bChnk.type));
chunks.Add(bChnk.sector, bChnk); chunks.Add(bChnk.sector, bChnk);

View File

@@ -465,11 +465,24 @@ namespace DiscImageChef.DiscImages
if(bChnk.type == ChunkType_Commnt) if(bChnk.type == ChunkType_Commnt)
continue; continue;
// TODO: Handle compressed chunks // TODO: Handle compressed chunks
if((bChnk.type & ChunkType_CompressedMask) == ChunkType_CompressedMask) if((bChnk.type == ChunkType_KenCode))
throw new ImageNotSupportedException("Compressed chunks are not yet supported."); throw new ImageNotSupportedException("Chunks compressed with KenCode are not yet supported.");
if((bChnk.type == ChunkType_RLE))
throw new ImageNotSupportedException("Chunks compressed with RLE are not yet supported.");
if((bChnk.type == ChunkType_LZH))
throw new ImageNotSupportedException("Chunks compressed with LZH are not yet supported.");
if((bChnk.type == ChunkType_ADC))
throw new ImageNotSupportedException("Chunks compressed with ADC are not yet supported.");
if((bChnk.type == ChunkType_Zlib))
throw new ImageNotSupportedException("Chunks compressed with zlib are not yet supported.");
if((bChnk.type == ChunkType_Bzip))
throw new ImageNotSupportedException("Chunks compressed with bzip2 are not yet supported.");
if((bChnk.type == ChunkType_LZFSE))
throw new ImageNotSupportedException("Chunks compressed with lzfse are not yet supported.");
if(bChnk.type != ChunkType_Zero && bChnk.type != ChunkType_Copy && bChnk.type != ChunkType_NoCopy) if((bChnk.type > ChunkType_NoCopy && bChnk.type < ChunkType_Commnt) ||
(bChnk.type > ChunkType_LZFSE && bChnk.type < ChunkType_End))
throw new ImageNotSupportedException(string.Format("Unsupported chunk type 0x{0:X8} found", bChnk.type)); throw new ImageNotSupportedException(string.Format("Unsupported chunk type 0x{0:X8} found", bChnk.type));
if(bChnk.sectors > 0) if(bChnk.sectors > 0)