Deploying '/Users/**/Projects/**/**'
to namespace 'fn-**'
on host 'https://**.doserverless.co'
Submitted function 'sample/hello' for remote building and deployment in runtime go:default (id: 6385b32b4639433585b32b4639b3359a)
Transcript of remote build session for action 'sample/hello':
Output of failed build in %s
/tmp/slices/builds/fn-**/sample_hello/2024-01-29T13-22-28.710Z/packages/sample/hello
downloading modules
building
# pkg-config --cflags -- vips
Package vips was not found in the pkg-config search path.
Perhaps you should add the directory containing `vips.pc'
to the PKG_CONFIG_PATH environment variable
No package 'vips' found
pkg-config: exit status 1
with the following code
package main
import (
"fmt"
"io"
"net/http"
"os"
"github.com/davidbyttow/govips/v2/vips"
)
func checkError(err error) {
if err != nil {
fmt.Println("error:", err)
os.Exit(1)
}
}
func Main() {
vips.Startup(nil)
_// fetch image_
url := "https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg"
response, _ := http.Get(url)
image1bytes, err := io.ReadAll(response.Body)
checkError(err)
image1, err := vips.NewThumbnailFromBuffer(image1bytes, 200, 200, vips.InterestingCentre)
checkError(err)
_// Rotate the picture upright and reset EXIF orientation tag_
err = image1.AutoRotate()
checkError(err)
ep := vips.NewDefaultJPEGExportParams()
image1bytes, _, err = image1.Export(ep)
checkError(err)
err = os.WriteFile("output.jpg", image1bytes, 0644)
checkError(err)
vips.Shutdown()
}
would love some insight on what to do. I tried finding this in the docs somewhere but I had no luck.
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey!
The error message:
indicates that the
pkg-config
tool can’t find thelibvips
development files. This is because DigitalOcean Functions, being a serverless environment, doesn’t havelibvips
installed by default.As of the time being I don’t think that there is a way to install custom dependencies with the serverless functions, the best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.
An alternative option would be to switch to the App Platform and use a Dockerfile for your function deployment. This way, you can ensure that the
libvips
library is available during both build and runtime:Hope that helps!
- Bobby.