GithubHelp home page GithubHelp logo

Comments (10)

margen2 avatar margen2 commented on June 13, 2024 6

@Rusinas

install https://www.msys2.org/
use this link for reference: https://stackoverflow.com/questions/30069830/how-to-install-mingw-w64-and-msys2

On the MSYS2 terminal, you want to install pkg-config:
pacman -S pkg-config

Install libvips, but you need exactly this version:
https://github.com/libvips/libvips/releases/tag/v8.12.0
add it to your path and run:
vips --version

Then, run on cmd:
set PKG_CONFIG_PATH=C:\Users\You\Path\To\vips-dev-8.12\lib\pkgconfig

Confirm that it worked by running:
pkg-config --list-all

Now you should be able to use bimg.

from bimg.

margen2 avatar margen2 commented on June 13, 2024 2

You need cgo enabled to use bimg, you won't be able to run it with CGO_ENABLED=0.
As for the docker issue, it seems to be related to docker and not libvips or bimg. It may be an issue with CRLF/LF:
https://stackoverflow.com/questions/68881023/docker-standard-init-linux-go228-exec-user-process-caused-no-such-file-or-dir
I also spent too much time trying to make it work 😅

from bimg.

tinkerbaj avatar tinkerbaj commented on June 13, 2024 1

OK, this is how I fix it. I use WSL and try to run it I get the same thing. then I install pkg-config I get another error something like pkg-config vips vips vips
and I install libvips-dev and it work now :)

from bimg.

Rusinas avatar Rusinas commented on June 13, 2024

@margen2 OH MY GOD THANK YOU I GOT THIS WORKING

Also... This is unrelated, but I don't think it worth creating another topic: while I was trying to solve this problem, I've tried to run everything inside of a docker container and the problem there was that I had to disable cgo for some reason (ENV CGO_ENABLED=0). If I disable it, errors was in bimg:

#11 2.353 # github.com/h2non/bimg
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:93:49: undefined: Gravity
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:133:29: undefined: Watermark
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:139:34: undefined: WatermarkImage
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:152:26: undefined: Angle
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:181:31: undefined: Interpretation
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:202:27: undefined: Options
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:212:29: undefined: ImageMetadata
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:218:35: undefined: Interpretation
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/image.go:234:25: undefined: ImageSize
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/resize.go:11:27: undefined: Options
#11 2.353 /go/pkg/mod/github.com/h2non/[email protected]/resize.go:11:27: too many errors

But if I didn't I will get this error, even though the container build successfully:
standard_init_linux.go:228: exec user process caused: no such file or directory

from bimg.

etareduction avatar etareduction commented on June 13, 2024

@margen2 After all of that I'm still getting fatal error: vips/vips.h: No such file or directory. When i run pkg-config --list-all it shows vips in the list.

from bimg.

margen2 avatar margen2 commented on June 13, 2024

@etareduction I have just tried following those steps on a fresh win10 computer and it worked as expected. I remember seeing this error while trying to use a different version of libvips, I used this version: https://github.com/libvips/build-win64-mxe/releases/download/v8.12.0/vips-dev-w64-all-8.12.0.zip and make sure to uninstall any other version you may have left.
With go 1.20 cgo may be disabled on your machine, confirm that it is set to CGO_ENABLED=1.

from bimg.

etareduction avatar etareduction commented on June 13, 2024

@margen2 Yeah, I've installed only version 8.12.0 and i'm sure cgo is enabled.
Edit: Now when i looked at it, it seems I've installed web version, not all. Can that be a problem? I would like to use web one cause that's what i would use in production anyways.

from bimg.

margen2 avatar margen2 commented on June 13, 2024

@etareduction I would at least try again with the all version just to confirm.

from bimg.

etareduction avatar etareduction commented on June 13, 2024

@etareduction I would at least try again with the all version just to confirm.

I'm not sure if i could find time for that right now, pretty busy at my project. For the time being, I've workaround this issue by using WSL and installing libvips from apt.

from bimg.

tinkerbaj avatar tinkerbaj commented on June 13, 2024

For me it is the same with all, this is what I get
image

from bimg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.