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