mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-17 11:16:34 -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) {
|
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)
|
||||||
|
|
|
||||||
6
vips.go
6
vips.go
|
|
@ -24,6 +24,12 @@ var debug = d.Debug("bimg")
|
||||||
// VipsVersion exposes the current libvips semantic version
|
// VipsVersion exposes the current libvips semantic version
|
||||||
const VipsVersion = string(C.VIPS_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
|
// HasMagickSupport exposes if the current libvips compilation
|
||||||
// supports libmagick bindings.
|
// supports libmagick bindings.
|
||||||
const HasMagickSupport = int(C.VIPS_MAGICK_SUPPORT) == 1
|
const HasMagickSupport = int(C.VIPS_MAGICK_SUPPORT) == 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue