Skip to content

coverimage: only update on rotation if rotate image enabled#15179

Merged
Frenzie merged 1 commit into
koreader:masterfrom
liskin:coverimage-rotate-fix
Mar 25, 2026
Merged

coverimage: only update on rotation if rotate image enabled#15179
Frenzie merged 1 commit into
koreader:masterfrom
liskin:coverimage-rotate-fix

Conversation

@liskin

@liskin liskin commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Creating the cover image delays rotation a little bit (half a second, even if cached), although it could be several seconds on some PocketBook devices since #14985 which synchronously invokes sync after creating the cover.

To work around this, skip creating the image in the onSetRotationMode event hook if "Rotate image" is disabled as the resulting image would be exactly the same. The speedup is noticeable even if the cover cache gets hit.

The issue with synchronous sync taking several seconds will be fixed later once we figure out whether any PocketBook devices actually need the sync or not.
See #15177 for details. (Note that this PR doesn't completely fix that issue! It's just a partial workaround and requires disabling "Rotate image".)


This change is Reviewable

Creating the cover image delays rotation a little bit (half a second,
even if cached), although it could be several seconds on some PocketBook
devices since koreader#14985 which synchronously invokes `sync` after creating
the cover.

To work around this, skip creating the image in the onSetRotationMode
event hook if "Rotate image" is disabled as the resulting image would be
exactly the same. The speedup is noticeable even if the cover cache gets
hit.

(The issue with synchronous `sync` taking several seconds will be fixed
later once we figure out whether any PocketBook devices actually need
the `sync` or not.)

Related: koreader#15177
Related: koreader#14985
@Frenzie Frenzie merged commit df0b3ea into koreader:master Mar 25, 2026
4 checks passed
@Frenzie Frenzie added this to the 2026.05 milestone Mar 25, 2026
@liskin liskin deleted the coverimage-rotate-fix branch March 25, 2026 10:16
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
…#15179)

Creating the cover image delays rotation a little bit (half a second,
even if cached), although it could be several seconds on some PocketBook
devices since koreader#14985 which synchronously invokes `sync` after creating
the cover.

To work around this, skip creating the image in the onSetRotationMode
event hook if "Rotate image" is disabled as the resulting image would be
exactly the same. The speedup is noticeable even if the cover cache gets
hit.

(The issue with synchronous `sync` taking several seconds will be fixed
later once we figure out whether any PocketBook devices actually need
the `sync` or not.)

Related: koreader#15177
Related: koreader#14985
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants