|
|
|
@ -42,6 +42,7 @@ func TestImageSvgResize(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestImageGifToJpeg(t *testing.T) {
|
|
|
|
func TestImageGifToJpeg(t *testing.T) {
|
|
|
|
|
|
|
|
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
|
|
|
|
i := initImage("test.gif")
|
|
|
|
i := initImage("test.gif")
|
|
|
|
options := Options{
|
|
|
|
options := Options{
|
|
|
|
Type: JPEG,
|
|
|
|
Type: JPEG,
|
|
|
|
@ -53,8 +54,10 @@ func TestImageGifToJpeg(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
Write("fixtures/test_gif.jpg", buf)
|
|
|
|
Write("fixtures/test_gif.jpg", buf)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestImagePdfToJpeg(t *testing.T) {
|
|
|
|
func TestImagePdfToJpeg(t *testing.T) {
|
|
|
|
|
|
|
|
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
|
|
|
|
i := initImage("test.pdf")
|
|
|
|
i := initImage("test.pdf")
|
|
|
|
options := Options{
|
|
|
|
options := Options{
|
|
|
|
Type: JPEG,
|
|
|
|
Type: JPEG,
|
|
|
|
@ -66,8 +69,10 @@ func TestImagePdfToJpeg(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
Write("fixtures/test_pdf.jpg", buf)
|
|
|
|
Write("fixtures/test_pdf.jpg", buf)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestImageSvgToJpeg(t *testing.T) {
|
|
|
|
func TestImageSvgToJpeg(t *testing.T) {
|
|
|
|
|
|
|
|
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
|
|
|
|
i := initImage("test.svg")
|
|
|
|
i := initImage("test.svg")
|
|
|
|
options := Options{
|
|
|
|
options := Options{
|
|
|
|
Type: JPEG,
|
|
|
|
Type: JPEG,
|
|
|
|
@ -79,6 +84,7 @@ func TestImageSvgToJpeg(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
Write("fixtures/test_svg.jpg", buf)
|
|
|
|
Write("fixtures/test_svg.jpg", buf)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestImageResizeAndCrop(t *testing.T) {
|
|
|
|
func TestImageResizeAndCrop(t *testing.T) {
|
|
|
|
buf, err := initImage("test.jpg").ResizeAndCrop(300, 200)
|
|
|
|
buf, err := initImage("test.jpg").ResizeAndCrop(300, 200)
|
|
|
|
|