mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-13 17:30:28 -07:00
feat(#60): support zero top and left params in extract operation
This commit is contained in:
parent
89292e7ead
commit
b7eaa00f10
4 changed files with 26 additions and 1 deletions
|
|
@ -48,6 +48,20 @@ func TestImageExtract(t *testing.T) {
|
|||
Write("fixtures/test_extract_out.jpg", buf)
|
||||
}
|
||||
|
||||
func TestImageExtractZero(t *testing.T) {
|
||||
buf, err := initImage("test.jpg").Extract(0, 0, 300, 200)
|
||||
if err != nil {
|
||||
t.Errorf("Cannot process the image: %s", err)
|
||||
}
|
||||
|
||||
err = assertSize(buf, 300, 200)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
Write("fixtures/test_extract_zero_out.jpg", buf)
|
||||
}
|
||||
|
||||
func TestImageEnlarge(t *testing.T) {
|
||||
buf, err := initImage("test.png").Enlarge(500, 375)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue