Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumbnail generation #17

Merged
merged 20 commits into from
May 23, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions kobo-uncaged/kutypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,26 @@ func (d koboDevice) CoverSize() (fullCover, libFull, libGrid image.Point) {
}
return fc, lf, lg
}

// FullCover gets the appropriate cover dimensions for the device. These values
// come from Image::sizeForType in the Kobo firmware.
// See https://github.com/shermp/Kobo-UNCaGED/issues/16#issuecomment-494229994
// for more details.
func (d koboDevice) FullCover() image.Point {
switch d {
case auraOne, auraOneLE: // daylight
return image.Pt(1404, 1872)
case gloHD, claraHD: // alyssum, nova
return image.Pt(1072, 1448)
case auraHD, auraH2O, auraH2Oed2r1, auraH2Oed2r2: // dragon
return image.Pt(1080, 1440)
pgaskin marked this conversation as resolved.
Show resolved Hide resolved
case glo, auraEd2r1, auraEd2r2: // kraken, star
return image.Pt(758, 1024)
case aura: // phoenix
return image.Pt(758, 1014)
case forma, forma32gb: // frost
return image.Pt(1440, 1920)
default: // KoboWifi, KoboTouch, trilogy, KoboTouch2
return image.Pt(600, 800)
}
}