mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-09 07:28:44 -07:00
fix(tests)
This commit is contained in:
parent
3f889aaf0a
commit
489fbc8a00
5 changed files with 39 additions and 27 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue