Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
admpub committed Apr 23, 2021
1 parent 1f076e2 commit 16ba3fe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions upload/watermark/watermark.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"io"
"io/ioutil"
"os"

rifs "github.com/admpub/go-utility/filesystem"

Expand All @@ -17,9 +16,9 @@ func Write(rw io.ReadWriteSeeker, ext string, opt *image.WatermarkOptions) ([]by
return nil, fmt.Errorf(`NewWatermark: %w`, err)
}
err = wm.Mark(rw, ext)
rw.Seek(0, os.SEEK_SET)
rw.Seek(0, io.SeekStart)
if err != nil {
return nil, fmt.Errorf(`Mark: %w`)
return nil, fmt.Errorf(`Mark: %w`, err)
}
return ioutil.ReadAll(rw)
}
Expand All @@ -39,7 +38,7 @@ func Bytes2readWriteSeeker(b []byte) (io.ReadWriteSeeker, error) {
if err != nil {
return sb, err
}
sb.Seek(0, os.SEEK_SET)
sb.Seek(0, io.SeekStart)
return sb, err
}

Expand Down

0 comments on commit 16ba3fe

Please sign in to comment.