mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-18 19:56:31 -07:00
fix(tests)
This commit is contained in:
parent
3f889aaf0a
commit
489fbc8a00
5 changed files with 39 additions and 27 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 0 B |
Binary file not shown.
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 0 B |
Binary file not shown.
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 0 B |
|
|
@ -42,6 +42,7 @@ func TestImageSvgResize(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestImageGifToJpeg(t *testing.T) {
|
||||
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
|
||||
i := initImage("test.gif")
|
||||
options := Options{
|
||||
Type: JPEG,
|
||||
|
|
@ -52,9 +53,11 @@ func TestImageGifToJpeg(t *testing.T) {
|
|||
}
|
||||
|
||||
Write("fixtures/test_gif.jpg", buf)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImagePdfToJpeg(t *testing.T) {
|
||||
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
|
||||
i := initImage("test.pdf")
|
||||
options := Options{
|
||||
Type: JPEG,
|
||||
|
|
@ -65,9 +68,11 @@ func TestImagePdfToJpeg(t *testing.T) {
|
|||
}
|
||||
|
||||
Write("fixtures/test_pdf.jpg", buf)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageSvgToJpeg(t *testing.T) {
|
||||
if VipsMinorVersion >= 8 && VipsMinorVersion > 2 {
|
||||
i := initImage("test.svg")
|
||||
options := Options{
|
||||
Type: JPEG,
|
||||
|
|
@ -78,6 +83,7 @@ func TestImageSvgToJpeg(t *testing.T) {
|
|||
}
|
||||
|
||||
Write("fixtures/test_svg.jpg", buf)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageResizeAndCrop(t *testing.T) {
|
||||
|
|
|
|||
6
vips.go
6
vips.go
|
|
@ -24,6 +24,12 @@ var debug = d.Debug("bimg")
|
|||
// VipsVersion exposes the current libvips semantic version
|
||||
const VipsVersion = string(C.VIPS_VERSION)
|
||||
|
||||
// VipsMajorVersion exposes the current libvips major version number
|
||||
const VipsMajorVersion = string(C.VIPS_MAJOR_VERSION)
|
||||
|
||||
// VipsMinorVersion exposes the current libvips minor version number
|
||||
const VipsMinorVersion = int(C.VIPS_MINOR_VERSION)
|
||||
|
||||
// HasMagickSupport exposes if the current libvips compilation
|
||||
// supports libmagick bindings.
|
||||
const HasMagickSupport = int(C.VIPS_MAGICK_SUPPORT) == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue