mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-15 18:35:54 -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,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) {
|
||||||
|
|
|
||||||
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