Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/backends/compression/png/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func CheckPngquantInstalled() (string, error) {
"linux": config.PngquantBinaryName,
"windows": config.PngquantBinaryName + ".exe",
"darwin": config.PngquantBinaryName,
"freebsd": config.PngquantBinaryName,
}

destFolder := filepath.Join(config.GowallConfig.OutputFolder, "compression", "pngquant")
Expand Down
5 changes: 5 additions & 0 deletions internal/backends/onnx/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ func SharedLibraryName() string {
switch runtime.GOOS {
case "linux":
return fmt.Sprintf("libonnxruntime.so.%s", onnxRuntimeVersion)
case "freebsd":
return fmt.Sprintf("libonnxruntime.so")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by you using libonnxruntime.so here you make it so gowall uses the shared library that your system has available that you have installed by your package manager.

I don't want to do that, gowall downloads the shared library and places it inside ~/.u2net or whatever you have configured in the config.yml like OnnxRuntimeFolderPath: "~/.mycustomfolder".

Also i want to pin shared library to a specific version i download. Change it to

return fmt.Sprintf("libonnxruntime.so.%s", onnxRuntimeVersion)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FreeBSD package will depend on ONNX by default, so it will be available in the system.

The last time I've checked, onnxRuntimeVersion was not in-sync with the FreeBSD package of onnxRuntime. So, I think it's better to remove it completely here for FreeBSD.

case "darwin":
return fmt.Sprintf("libonnxruntime.%s.dylib", onnxRuntimeVersion)
case "windows":
Expand Down Expand Up @@ -156,6 +158,9 @@ func SetupOnnxRuntime() error {
// CheckOnnxRuntimeInstalled checks if the ONNX runtime shared library is available
func CheckOnnxRuntimeInstalled() (string, error) {
destFolder := config.GowallConfig.OnnxRuntimeFolderPath
if runtime.GOOS == "freebsd" {
destFolder = filepath.Join("/usr/local", "lib")

@Achno Achno May 7, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here you trying to get the onnx shared lib from /usr/local while i want to download it manually, so a user doesnt have to download it with their package manager and works everywhere for every platform.

Remove this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe they don't ship binaries for FreeBSD platform, so I use package versions of them in FreeBSD.

}
libName := SharedLibraryName()

if libName == "" {
Expand Down
5 changes: 5 additions & 0 deletions internal/image/upscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"

"github.com/Achno/gowall/config"
imageio "github.com/Achno/gowall/internal/image_io"
Expand All @@ -21,6 +22,9 @@ type UpscaleProcessor struct {

func (p *UpscaleProcessor) Process(img image.Image, theme string, format string) (image.Image, types.ImageMetadata, error) {
destFolder := filepath.Join(config.GowallConfig.OutputFolder, "upscaler")
if runtime.GOOS == "freebsd" {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here

destFolder = filepath.Join("/usr/local", "bin")
}
// setup upscaler if it has not been already
if _, err := os.Stat(destFolder); os.IsNotExist(err) {

Expand All @@ -35,6 +39,7 @@ func (p *UpscaleProcessor) Process(img image.Image, theme string, format string)
"windows": "realesrgan-ncnn-vulkan.exe",
"darwin": "realesrgan-ncnn-vulkan",
"linux": "realesrgan-ncnn-vulkan",
"freebsd": "realesrgan-ncnn-vulkan",
}

binary, err := utils.FindBinary(binaryNames, destFolder)
Expand Down