Closed
Description
Below is a test program that illustrates the problem if applied against the attached jpeg. _, _, err := image.Decode(rdr) "error image: unknown format" --------------------------- package main import ( "bufio" "fmt" "image" "net/http" "os" ) func main() { file, _ := os.Open("tryme.jpeg") defer file.Close() rdr := bufio.NewReader(file) bts, _ := rdr.Peek(512) contentType := http.DetectContentType(bts) fmt.Println(contentType) _, _, err := image.Decode(rdr) if err != nil { fmt.Println("error " + err.Error()) } fmt.Println("done") }
Attachments:
- tryme.jpeg (2594 bytes)