Skip to content

EPUB: Scroll mode page numbers broken #3282

@Frenzie

Description

@Frenzie
  • KOReader version: 180f575 but likely going back much further
  • Device: all

Issue

Enabling scroll mode in EPUB causes crashes related to page numbers and TOC markers.

Steps to reproduce

Almost any random EPUB with more than one page should do. For example, notice how 10_2-BF-01.epub from Html401/ in the EPUB test suite, a 3 page document, claims to have a thousand.

screenshot_2017-10-01_09-28-18
screenshot_2017-10-01_09-28-23
screenshot_2017-10-01_09-28-27

Doing something that requires interaction with page numbers will trigger an error like this:

./luajit: frontend/ui/widget/bookstatuswidget.lua:259: attempt to perform arithmetic on field 'page' (a nil value)
stack traceback:
	frontend/ui/widget/bookstatuswidget.lua:259: in function 'genBookInfoGroup'
	frontend/ui/widget/bookstatuswidget.lua:125: in function 'getStatusContent'
	frontend/ui/widget/bookstatuswidget.lua:86: in function 'init'
	frontend/ui/widget/widget.lua:48: in function 'new'
	frontend/apps/reader/modules/readerstatus.lua:45: in function 'showStatus'
	frontend/apps/reader/modules/readerstatus.lua:29: in function 'handleEvent'
	frontend/ui/widget/container/widgetcontainer.lua:87: in function 'propagateEvent'
	frontend/ui/widget/container/widgetcontainer.lua:105: in function 'handleEvent'
	frontend/apps/reader/modules/readerrolling.lua:440: in function 'onGotoViewRel'
	frontend/apps/reader/modules/readerrolling.lua:296: in function 'handler'
	frontend/ui/widget/container/inputcontainer.lua:197: in function 'handleEvent'
	frontend/ui/uimanager.lua:442: in function 'sendEvent'
	frontend/ui/uimanager.lua:43: in function '__default__'
	frontend/ui/uimanager.lua:720: in function 'handleInput'
	frontend/ui/uimanager.lua:765: in function 'run'
	./reader.lua:178: in main chunk
	[C]: at 0x55cc9d7590b0
~/src/kobo/koreader

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions