Skip to content

Commit

Permalink
Fix FS import compression
Browse files Browse the repository at this point in the history
  • Loading branch information
myst6re committed May 25, 2024
1 parent c418ed5 commit ea8f539
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,18 @@ void CLI::commandImport()
}
QByteArray data = f.readAll(), compressedData;
f.close();
quint32 uncompressedSize = quint32(data.size());
quint32 uncompressedSize = quint32(data.size()), compressedSize = 0;

switch (compressionFormat) {
case FiCompression::CompressionLzs:
compressedData = LZS::compress(data);
compressedSize = quint32(data.size());
compressedData.prepend((const char *)&compressedSize, 4);
break;
case FiCompression::CompressionLz4:
compressedData = QLZ4::compress(data);
compressedSize = quint32(data.size());
compressedData.prepend((const char *)&compressedSize, 4);
break;
case FiCompression::CompressionNone:
case FiCompression::CompressionUnknown:
Expand Down

0 comments on commit ea8f539

Please sign in to comment.