Open mattzab opened 5 years ago
Odd, the "Really Boring Demo" example zip seems to work which only has an index.html
file:
http://zip2zim.openzim.org/#upload
@ISNIT0 Do you need something from @mattzab our me. Might that be that the JSON is OK, but somehow the relation to the content of the ZIP is wrong?
@ISNIT0 When I tested the website 4 times using examples from the site, 2 of the uploads resulted in a zim being generated and 2 did not. From memory (I wasn't keeping notes) I tried the following:
simple.zip
- failed: no file generatedsimple.zip
- worked: zim file generatedtesting_heuristics.zip
- worked: zim file generatedsunset.zip
- failed: no file generatedsunset.zip
]() - worked zim file generatedI've tried several more times, using the upload option from the homepage which worked and from the samples page (see above).
As you say, none of these files have a config.json
so there may be another reason why sometimes the process fails...
Nonetheless providing examples that do include config.json
may well help people to create more informative ZIM files :)
I forgot to mention that when I uploaded a large ZIP file (around 893MB) the process failed and I saw an express message that the failure might be caused by a missing config.json
Here's the error page: https://zip2zim.openzim.org/fail.html#examples
Looks like we failed to generate your Zim file!
Usually this is caused by a broken config.json
file.
If you're stuck, please open a GitHub issue.
@ISNIT0 I've spotted something that seems odd in the code build/index.js
(presumably generated by npm start
with the source of https://github.com/openzim/zip2zim/blob/master/index.ts where the catch codeblock copies favicon.png when config.json is not available. Perhaps, at least part of the confusion is related to this code? I'd expect it to copy a default config.json
from ./res/
(assuming one existed there). Or have I misunderstood what this code is intended to do?
try {
var overrideConfig = JSON.parse(fs.readFileSync("./pool/" + id + "/content/config.json", 'utf8') || '{}');
Object.assign(config, overrideConfig);
}
catch (e) {
copyFileSync('./res/favicon.png', "./pool/" + id + "/content/favicon.png");
}
Possibly caused by an unrelated problem generating the zim? see #22 for an example of a problem, albeit one that resulted in another message...
Yes, see this: https://github.com/openzim/zip2zim/issues/24
As part of the rewrite, how about the code logs/reports the configuration settings it used so users can see/check which settings were incorporated into the ZIM file?
Zip2Zim requires config.json, but this is undocumented.
The webpage makes it appear as if config.json is optional for customization, but conversion will fail if this file is missing- even with index.html in the root.
As an example of a non-working json file I attempted to use within my zip file, see here.
No documentation can be found for what exactly is expected, and it is not clear that this file is required.
Solution: Add documentation to zip2zim.openzim.org webpage with examples, as well as possibly adding it to the readme.md file on this github project.