Closed fabri9532 closed 4 years ago
Hi! First of all, thank you for using bit7z!
When I add a file or directory to an existing archive, the total size reported by the CallBack "TotalCallback" is wrong.
See the following code. When I add the file "b.txt", the total size has an incorrect value (not equal to size of "b.txt"). The problem also occurs when I use "compressDirectory".
Actually, in this specific case the total size reported by TotalCallback
is correct, since it must not be equal to the size of b.txt
.
Such "size", in fact, refers to the total number of bytes going to be processed by the compression operation. Now, since you are updating an existing archive, the total size also includes the compressed size of this latter (in your case, of a.txt
).
As a further explanation, if you add a third file c.txt
, the total size passed to the callback will be: compressed size of a.txt
and b.txt
+ size of c.txt
.
Note: the compressed size of the archive does not consider its metadata, hence generally compressed size != archive size (more precisely, <=).
When I add a file or directory to an existing archive, the total size reported by the CallBack "TotalCallback" is wrong.
See the following code. When I add the file "b.txt", the total size has an incorrect value (not equal to size of "b.txt"). The problem also occurs when I use "compressDirectory".
//Code ----------
include "bitcompressor.hpp"
include "bitexception.hpp"
include "bitformat.hpp"
void TotalCallbackProc(uint64_t total_size); void ProgressCallbackProc(uint64_t progress_size);
using namespace bit7z;
int main() { try { Bit7zLibrary lib{ L"7z.dll" };
}
void TotalCallbackProc(uint64_t total_size) { //When compress "b.txt" the parameter total_size has a wrong value. }
void ProgressCallbackProc(uint64_t progress_size) { } // End Code ----------