Skip to content

Commit

Permalink
Add more decoders and tell which file failed (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly authored Sep 24, 2024
1 parent 736d572 commit 627b4ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ansipixels/fps/fps.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func imagesViewer(ap *ansipixels.AnsiPixels, imageFiles []string) int {
for _, imageFile := range imageFiles {
img, err := ap.ReadImage(imageFile)
if err != nil {
return log.FErrf("Error reading image: %v", err)
return log.FErrf("Error reading image %s: %v", imageFile, err)
}
if err = ap.ShowImage(img, "\033[34m"); err != nil {
return log.FErrf("Error showing image: %v", err)
Expand Down
4 changes: 4 additions & 0 deletions ansipixels/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
"fortio.org/log"
"fortio.org/safecast"
"golang.org/x/image/draw"
_ "golang.org/x/image/tiff" // Import tiff decoder
_ "golang.org/x/image/vp8" // Import VP8 decoder
_ "golang.org/x/image/vp8l" // Import VP8L decoder
_ "golang.org/x/image/webp" // Import WebP decoder
)

type Image struct {
Expand Down

0 comments on commit 627b4ef

Please sign in to comment.