davidbyttow / govips

A lightning fast image processing and resizing library for Go
MIT License
1.28k stars 199 forks source link

download vips for you. #342

Closed gedw99 closed 1 year ago

gedw99 commented 1 year ago

It's possible to make it even easier for users / developers.

This ones works really well for ffmpeg. DO you know if there are vips downloaded somewhere for all OS and ISA ( arm, amd64, etc) ?

https://github.com/stashapp/stash/blob/develop/pkg/ffmpeg/downloader.go

func getFFMPEGURL() []string {
    var urls []string
    switch runtime.GOOS {
    case "darwin":
        urls = []string{"https://evermeet.cx/ffmpeg/getrelease/zip", "https://evermeet.cx/ffmpeg/getrelease/ffprobe/zip"}
    case "linux":
        switch runtime.GOARCH {
        case "amd64":
            urls = []string{"https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffmpeg-4.2.1-linux-64.zip", "https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffprobe-4.2.1-linux-64.zip"}
        case "arm":
            urls = []string{"https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffmpeg-4.2.1-linux-armhf-32.zip", "https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffprobe-4.2.1-linux-armhf-32.zip"}
        case "arm64":
            urls = []string{"https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffmpeg-4.2.1-linux-arm-64.zip", "https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffprobe-4.2.1-linux-arm-64.zip"}
        }
    case "windows":
        urls = []string{"https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip"}
    default:
        urls = []string{""}
    }
    return urls
gedw99 commented 1 year ago

windows binaries for all ISA is here: https://github.com/libvips/build-win64-mxe

tonimelisma commented 1 year ago

Hey. Apologies but I'm not sure how this relates to govips. If you are looking for vips downloads it's probably best to look at the libvips repositories.

gedw99 commented 1 year ago

no worries.

It relates because it makes it much easier to work with govips because oyu dont have cross platform fun and games with binding to the libvips packages.

I did the same with FFMPEG. The ffmpeg binaries for the respective OS and ISA are pulled at compile time and then its easy at dev time and also at packaging time. It also makee CI easier because in CI it does the exact same things.

DOes this help ?