We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69c8502 commit b841c7eCopy full SHA for b841c7e
1 file changed
lib/image/file.go
@@ -82,6 +82,9 @@ func (f *File) GetSavings() (int64, error) {
82
func (f *File) Write(c *config.Config) (err error) {
83
if c.App.Sizes != nil {
84
for _, r := range c.App.Sizes {
85
+ if r.Height <= 0 || r.Width <= 0 {
86
+ continue
87
+ }
88
i := imaging.Fill(f.Image, r.Width, r.Height, imaging.Center, imaging.Lanczos)
89
buf, err := encToBuf(i, c.App)
90
dest := path.Join(c.App.OutDir, c.App.Prefix+f.Name+"--"+r.String()+c.App.Suffix+"."+c.App.Target)
0 commit comments