fix(tests)

This commit is contained in:
Tomas Aparicio 2016-09-27 15:12:41 +01:00
parent 3f889aaf0a
commit 489fbc8a00
5 changed files with 39 additions and 27 deletions

View file

@ -42,42 +42,48 @@ func TestImageSvgResize(t *testing.T) {
}
func TestImageGifToJpeg(t *testing.T) {
i := initImage("test.gif")
options := Options{
Type: JPEG,
}
buf, err := i.Process(options)
if err != nil {
t.Errorf("Cannot process the image: %#v", err)
}
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
i := initImage("test.gif")
options := Options{
Type: JPEG,
}
buf, err := i.Process(options)
if err != nil {
t.Errorf("Cannot process the image: %#v", err)
}
Write("fixtures/test_gif.jpg", buf)
Write("fixtures/test_gif.jpg", buf)
}
}
func TestImagePdfToJpeg(t *testing.T) {
i := initImage("test.pdf")
options := Options{
Type: JPEG,
}
buf, err := i.Process(options)
if err != nil {
t.Errorf("Cannot process the image: %#v", err)
}
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
i := initImage("test.pdf")
options := Options{
Type: JPEG,
}
buf, err := i.Process(options)
if err != nil {
t.Errorf("Cannot process the image: %#v", err)
}
Write("fixtures/test_pdf.jpg", buf)
Write("fixtures/test_pdf.jpg", buf)
}
}
func TestImageSvgToJpeg(t *testing.T) {
i := initImage("test.svg")
options := Options{
Type: JPEG,
}
buf, err := i.Process(options)
if err != nil {
t.Errorf("Cannot process the image: %#v", err)
}
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
i := initImage("test.svg")
options := Options{
Type: JPEG,
}
buf, err := i.Process(options)
if err != nil {
t.Errorf("Cannot process the image: %#v", err)
}
Write("fixtures/test_svg.jpg", buf)
Write("fixtures/test_svg.jpg", buf)
}
}
func TestImageResizeAndCrop(t *testing.T) {