Skip to content

Commit

Permalink
Merge pull request #3 from LeeWannacott/cut-sprite
Browse files Browse the repository at this point in the history
Check for .png extension when decoding images.
  • Loading branch information
kyle-wannacott authored Nov 1, 2024
2 parents d63eecf + 9808b80 commit b5c7a16
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Empty file added sprite_cut/test.gd
Empty file.
2 changes: 1 addition & 1 deletion src/gontage.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func decodeImages(sprites_folder []fs.DirEntry, targetFolder string, pwd string,
var sprites_array []image.Image
var sprites_names []string
for _, sprite := range sprites_folder {
if !sprite.IsDir() {
if !sprite.IsDir() && filepath.Ext(sprite.Name()) == ".png" {
if reader, err := os.Open(filepath.Join(pwd, targetFolder, sprite.Name())); err == nil {
m, _, err := image.Decode(reader)
if err != nil {
Expand Down

0 comments on commit b5c7a16

Please sign in to comment.