Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

index out of range #32

Closed
SR-G opened this issue Dec 29, 2017 · 8 comments
Closed

index out of range #32

SR-G opened this issue Dec 29, 2017 · 8 comments
Assignees
Labels

Comments

@SR-G
Copy link

SR-G commented Dec 29, 2017

A lof ot .epub files are generating these errors (at least the binary should not exist in panic when this is happening ...).

With last published BookBrowser release.

`
2017/12/29 21:35:04 Unlocking book index
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/geek1011/BookBrowser/vendor/github.com/nfnt/resize.imageYCbCrToYCC(0xc42014d580, 0xc)
/home/travis/gopath/src/github.com/geek1011/BookBrowser/vendor/github.com/nfnt/resize/ycc.go:220 +0x66a
github.com/geek1011/BookBrowser/vendor/github.com/nfnt/resize.Resize(0xc8, 0x0, 0xc032c0, 0xc42014d580, 0x2, 0x0, 0x0)
/home/travis/gopath/src/github.com/geek1011/BookBrowser/vendor/github.com/nfnt/resize/resize.go:173 +0x3775
github.com/geek1011/BookBrowser/modules/booklist.NewBookListFromDir(0xc420014044, 0x5, 0xc420018660, 0x19, 0x1, 0x0, 0x0, 0x0, 0x0)
/home/travis/gopath/src/github.com/geek1011/BookBrowser/modules/booklist/booklist.go:96 +0xc72
github.com/geek1011/BookBrowser/modules/server.(*Server).RefreshBookIndex(0xc42011d1f0, 0x0, 0x0)
/home/travis/gopath/src/github.com/geek1011/BookBrowser/modules/server/server.go:77 +0x151
main.main.func1(0xc4200ae840)
/home/travis/gopath/src/github.com/geek1011/BookBrowser/bookbrowser.go:122 +0x743
github.com/geek1011/BookBrowser/vendor/github.com/urfave/cli.HandleAction(0x8b0d00, 0xc4200de560, 0xc4200ae840, 0xc42005a420, 0x0)
/home/travis/gopath/src/github.com/geek1011/BookBrowser/vendor/github.com/urfave/cli/app.go:504 +0x7c
github.com/geek1011/BookBrowser/vendor/github.com/urfave/cli.(*App).Run(0xc420184000, 0xc420010190, 0x1, 0x1, 0x0, 0x0)
/home/travis/gopath/src/github.com/geek1011/BookBrowser/vendor/github.com/urfave/cli/app.go:268 +0x653
main.main()
/home/travis/gopath/src/github.com/geek1011/BookBrowser/bookbrowser.go:138 +0x5c6

`

@pgaskin
Copy link
Owner

pgaskin commented Dec 30, 2017

Hmm. So what does bookbrowser show in the web UI? Are the covers showing no cover, but the metadata is still there? Or are the books not showing at all?

Can you email me one of the bad books too so I can have a look?

@pgaskin
Copy link
Owner

pgaskin commented Dec 30, 2017

This issue may be related: nfnt/resize#58

I may have to look into using a different resizing library.

Maybe https://github.com/bamiaux/rez

@pgaskin pgaskin self-assigned this Dec 30, 2017
@pgaskin pgaskin added the bug label Dec 30, 2017
@SR-G
Copy link
Author

SR-G commented Dec 30, 2017

Sadly as said in the first post, the binary is just exiting in error (exit code 2), so there is of course no access to any UI as the process is not anymore running.

You are right about the resizing library being the culprit.
My guess would be to go for the libvips / bimg wrapper : https://github.com/h2non/bimg

Please find a .epub triggering the error here : http://dl.free.fr/mNcsrYQ39 (other than that, the .epub can be read without any problem through FBReader and cover is correctly displayed).

@pgaskin
Copy link
Owner

pgaskin commented Dec 30, 2017

OK, I'll work on fixing this ASAP. As for the wrapper libraries, I am trying to avoid ones using CGO, because it makes cross-compiling a PITA.

@pgaskin
Copy link
Owner

pgaskin commented Dec 30, 2017

This should be fixed now. Please try v3.0.4, and tell me if it works. Thanks for reporting this issue!

@pgaskin
Copy link
Owner

pgaskin commented Dec 30, 2017

Btw, the new image resizing library is 25% faster.

@SR-G
Copy link
Author

SR-G commented Dec 30, 2017

Yep, way better now, no more errors / no more exits on a test folder with ~1000 epubs (whereas several ones were generating failures before). Covers seem to be correctly displayed.
Thanks for the correction.

@pgaskin
Copy link
Owner

pgaskin commented Dec 30, 2017

No problem!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants