Skip to content

Commit

Permalink
cmd/dictgen: Enable images with base64 encoding by default (#1)
Browse files Browse the repository at this point in the history
Base64 images have been fixed for firmware 4.20.14601.

See #1 for more details.
  • Loading branch information
pgaskin committed Mar 2, 2020
1 parent 512c333 commit d05535b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ Options:
-h, --help Show this help text
If multiple dictfiles (*.df) are provided, they will be merged (duplicate entries are fine; they will be shown in sequential order). To read from stdin, use - as the filename.
Note that the only usable image method is currently removing them or using base64-encoding (for firmware 4.20.14601+; older versions segfault in the in-book dictionary), as embedded dict:/// image URLs cause the webviews to appear blank (this is a nickel bug). See https://github.com/geek1011/dictutil/issues/1 for more details.
See https://pgaskin.net/dictutil/dictgen for more information about the dictfile format.
```

**See [here](https://pgaskin.net/dictutil/dictgen) for information and examples of the dictfile format.**
Expand Down
4 changes: 2 additions & 2 deletions cmd/dictgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ func main() {
pflag.CommandLine.SortFlags = false
output := pflag.StringP("output", "o", "dicthtml.zip", "The output filename (will be overwritten if it exists) (- is stdout)")
crypt := pflag.StringP("crypt", "c", "", "Encrypt the dictzip using the specified encryption method (format: method:keyhex)")
imageMethod := pflag.StringP("image-method", "I", "remove", "How to handle images (if an image path is relative, it is loaded from the current dir) (base64 - optimize and encode as base64, embed - add to dictzip, remove)")
imageMethod := pflag.StringP("image-method", "I", "base64", "How to handle images (if an image path is relative, it is loaded from the current dir) (base64 - optimize and encode as base64, embed - add to dictzip, remove)")
help := pflag.BoolP("help", "h", false, "Show this help text")
pflag.Parse()

if *help || pflag.NArg() == 0 {
fmt.Fprintf(os.Stderr, "Usage: %s [options] dictfile...\n\nVersion: dictgen %s\n\nOptions:\n%s\nIf multiple dictfiles (*.df) are provided, they will be merged (duplicate entries are fine; they will be shown in sequential order). To read from stdin, use - as the filename.\n\nNote that images are currently unusable (with the exception of base64-encoded\n images in the full-screen dictionary) due to bugs in nickel. See https://github.com/geek1011/dictutil/commit/b403da2f458d50ebb45a3c52c2dd126be030c64d#commitcomment-37414958.\n\nSee https://pgaskin.net/dictutil/dictgen for more information about the dictfile format.\n", os.Args[0], version, pflag.CommandLine.FlagUsages())
fmt.Fprintf(os.Stderr, "Usage: %s [options] dictfile...\n\nVersion: dictgen %s\n\nOptions:\n%s\nIf multiple dictfiles (*.df) are provided, they will be merged (duplicate entries are fine; they will be shown in sequential order). To read from stdin, use - as the filename.\n\nNote that the only usable image method is currently removing them or using base64-encoding (for firmware 4.20.14601+; older versions segfault in the in-book dictionary if images are enabled), as embedded dict:/// image URLs cause the webviews to appear blank (this is a nickel bug). See https://github.com/geek1011/dictutil/issues/1 for more details.\n\nSee https://pgaskin.net/dictutil/dictgen for more information about the dictfile format.\n", os.Args[0], version, pflag.CommandLine.FlagUsages())
os.Exit(0)
return
}
Expand Down

0 comments on commit d05535b

Please sign in to comment.