-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content offset is ignored on macOS using LibZim 9.2.0 #886
Comments
I am not sure if this other issue is related to this or not, but might be: #670 |
How are you compiling libzim ? Do you use https://download.openzim.org/release/libzim/libzim_macos-x86_64-9.2.1.tar.gz (or the arm64 version) ? Do you have the same issue with an older version ? |
I believe @BPerlakiH is using libkiwix 13.1.0-1 release from https://download.kiwix.org/release/libkiwix/libkiwix_xcframework-13.1.0-1.tar.gz |
@BPerlakiH Can you test this https://tmp.kiwix.org/ci/dev_preview/test_reader/libkiwix_xcframework-2024-05-30.tar.gz ? |
@mgautierfr I did test this build, and it seems to have the same issue: here is a fragment of the logs from reading a css file:
It keeps repeating the same data, regardless of the offset. The actual output from 1024 sized chunks, is also repeating (the offset is not moving): /*
Problematic modules: {
"skins.minerva.base.reset": "missing",
"skins.minerva.content.styles": "missing",
"ext.cite.style": "missing",
"mobile.app.pagestyles.android": "missing"
}
*/
/*
MediaWiki:Common.css
*/
.incomplete {
background-color:#f2edb3;
border:2px solid #ffbd00;
padding:10px;
line-height:35px;
}
.incomplete p:before {
content:"!";
color:white;
display:block;
float:left;
font-size:35px;
line-height:35px;
padding:1px 14px;
background-color:#ffbd00;
border-radius:100px;
margin-right:10px;
}
pre,.mw-code {
background-color:#f2f2f2;
border:1px solid #a8a8a8;
border-radius:2px;
display:inline-block:overflow:scroll;
padding:5px;
margin-bottom:10px;
line-height:1;
}
code {
white-space:nowrap;
}
.page-Main_Page #firstHeading,.page-Main_Page #toc {
display:none;
}
#tagline {
display:none;
}
h1,h2,h3,h4,h5,h6 {
margin-top:40px;
margin-bottom:20px;
}
video {
height:auto!important;
}
.thumb {
padding:5px;
border:1px solid #bbb;
margin-left:10px;
}
a.exte/*
Problematic modules: {
"skins.minerva.base.reset": "missing",
"skins.minerva.content.styles": "missing",
"ext.cite.style": "missing",
"mobile.app.pagestyles.android": "missing"
}
*/
/*
MediaWiki:Common.css
*/
.incomplete {
background-color:#f2edb3;
border:2px solid #ffbd00;
padding:10px;
line-height:35px;
}
.incomplete p:before {
content:"!";
color:white;
display:block;
float:left;
font-size:35px;
line-height:35px;
padding:1px 14px;
background-color:#ffbd00;
border-radius:100px;
margin-right:10px;
}
pre,.mw-code {
background-color:#f2f2f2;
border:1px solid #a8a8a8;
border-radius:2px;
display:inline-block:overflow:scroll;
padding:5px;
margin-bottom:10px;
line-height:1;
}
code {
white-space:nowrap;
}
.page-Main_Page #firstHeading,.page-Main_Page #toc {
display:none;
}
#tagline {
display:none;
}
h1,h2,h3,h4,h5,h6 {
margin-top:40px;
margin-bottom:20px;
}
video {
height:auto!important;
}
.thumb {
padding:5px;
border:1px solid #bbb;
margin-left:10px;
}
a.exte/*
Problematic modules: {
"skins.minerva.base.reset": "missing",
"skins.minerva.content.styles": "missing",
"ext.cite.style": "missing",
"mobile.app.pagestyles.android": "missing"
}
*/
/*
MediaWiki:Common.css
*/ |
In this line https://github.com/kiwix/kiwix-apple/blob/main/Model/ZimFileService/ZimFileService.mm#L201, you return the |
🤦♂️ ohh.. that makes sense now, it is working as expected with those changes.. |
Under macOS Kiwix app, using LibZIM 9.2.0
We have the following code to read the content from the zim file using offset and size:
Which if I got this right has the corresponding C++ function here:
https://github.com/openzim/libzim/blob/main/src/item.cpp#L50C1-L50C61
My aim is to read the data in chunks, but it seems there's a bug with the offset.
Reading the entire data from
offset=0
toitem.getSize()
works as expected.Starting with
offset=0
and increasing thesize
also works as expected.Changing the offset, does not work, it seems to be ignored, I am keep getting back the same data.
I did tried it with
text/html
,webp image
and what I would like most to be working iswebm
video content.Here are some debug prints from
webm
chunks:It is the same on HTML as well read in chunks sized 100:
Note: I did tested it with a couple of unrelated ZIM files, and the offset was still ignored.
I even hard coded the offset values, and that still resulted in the same data returned.
The text was updated successfully, but these errors were encountered: