package main import ( "bytes" "git.gitorious.org/go-pkg/epub.git" "github.com/nfnt/resize" "image" "image/jpeg" "log" "os" "regexp" "strings" "unicode/utf8" ) func GetCover(e *epub.Epub, title string) (string, string) { /* Try first common names */ for _, p := range []string{"cover.jpg", "Images/cover.jpg", "cover.jpeg", "cover1.jpg", "cover1.jpeg"} { img := e.Data(p) if len(img) != 0 { return storeImg(img, title, ".jpg") } } /* search for img on the text */ exp, _ := regexp.Compile("