schierlm / BibleMultiConverter

Converter written in Java to convert between different Bible program formats
Other
124 stars 33 forks source link

EquipdEpub: mimetype should be stored uncompressed #83

Closed xeruf closed 12 months ago

xeruf commented 12 months ago

I downloaded and wanted to convert https://bibel.github.io/BuberRosenzweig/index.html to an epub (I hope EquipdEPUB is also readable without the app?), but got an error:

❯ java -jar BibleMultiConverter.jar RoundtripHTML BuberRosenzweig-RoundtripHTML EquipdEPUB
Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/janek/.config/java
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
    at biblemulticonverter.format.EquipdEPUB.doExport(EquipdEPUB.java:65)
    at biblemulticonverter.Main.main(Main.java:67)
schierlm commented 12 months ago

EquipdEpub format needs one or two export arguments:

>java -jar BibleMultiConverter.jar help EquipdEPUB
EquipdEPUB - Epub export format for Equipd Bible

Epub export format for Equipd Bible

Usage: EquipdEPUB <outfile> [-headlinesAfter|-noHeadlines]

When the optional -headlinesafter switch is given, headlines are exported after the
verse markers; this makes the headline appear inside the correct verse (instead of
the previous one), but the verse number will appear at the end of the previous
paragraph.

When the optional -noheadlines switch is given, headlines are not exported at all.

When adding the arguments, the exception hopefully goes away.

xeruf commented 10 months ago

true, just had to add an output file name unfortunately the resulting epub does not seem to be readable:

❯ java -jar BibleMultiConverter.jar RoundtripHTML BuberRosenzweig-RoundtripHTML EquipdEPUB buber
Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/janek/.config/java
❯ file buber.epub
buber.epub: Zip data (MIME type "K,("?)
schierlm commented 10 months ago

Probably depends on what tool you open it with. file requires the mimetype file inside the .zip to be uncompressed. I'll push a fix shortly that will store it uncompressed.

Probably if you unzip the epub and rezip it with an epub packager (e.g. ecancrusher) it could also work.