mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-09 07:28:44 -07:00
feat(#26): support zoom. several refactors and fixes
This commit is contained in:
parent
e603ddd10a
commit
58b2be80a5
7 changed files with 62 additions and 16 deletions
|
|
@ -119,16 +119,30 @@ func TestImageWatermark(t *testing.T) {
|
|||
|
||||
err = assertSize(buf, 800, 600)
|
||||
if err != nil {
|
||||
//t.Error(err)
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if DetermineImageType(buf) != PNG {
|
||||
//t.Fatal("Image is not jpeg")
|
||||
if DetermineImageType(buf) != JPEG {
|
||||
t.Fatal("Image is not jpeg")
|
||||
}
|
||||
|
||||
Write("fixtures/test_watermark_out.jpg", buf)
|
||||
}
|
||||
|
||||
func TestImageZoom(t *testing.T) {
|
||||
buf, err := initImage("test.jpg").Zoom(1)
|
||||
if err != nil {
|
||||
t.Errorf("Cannot process the image: %#v", err)
|
||||
}
|
||||
|
||||
err = assertSize(buf, 3360, 2100)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
Write("fixtures/test_zoom_out.jpg", buf)
|
||||
}
|
||||
|
||||
func TestImageFlip(t *testing.T) {
|
||||
buf, err := initImage("test.jpg").Flip()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue