Skip to content

Archive.getFilesize() returning the wrong file size #41

@MohitMaliFtechiz

Description

@MohitMaliFtechiz

We are encountering an issue with the getFilesize() method in the Archive, as it is returning an incorrect file size. Let's consider an example: the file 100r-off-the-grid_en_2023-07.zim should be 145.6 MB (or 149106 KiB), but when we retrieve the file size using Archive.getFilesize(), it returns 152684582 KiB, which is equivalent to 152684.582 MB.

To confirm this problem, we have a test case in our code repository at https://github.com/kiwix/java-libkiwix/blob/2f951febf31e52886457f521d10db3c78eec1db4/lib/src/test/test.java#L63C52-L63C52

assertEquals(66937, archive.getFilesize()); // The file size is in KiB

However, the expected file size of 66.937 MB is incorrect. In reality, the file size is 65.4 KB, as shown in the image below:

Screenshot from 2023-07-14 19-03-15

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions