Created
August 1, 2022 05:31
-
-
Save NickSablukov/be1f09a7cbf2ea553df58bff07527f22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (b *MosaicBuilder) loadImage(path string) (image.Image, error) { | |
infile, err := os.Open(path) | |
defer func(infile *os.File) { | |
_ = infile.Close() | |
}(infile) | |
if err != nil { | |
return nil, err | |
} | |
src, err := tga.Decode(infile) | |
if err != nil { | |
return nil, err | |
} | |
return resize.Resize(b.partSize, b.partSize, src, resize.Lanczos3), nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment