Giter Club home page Giter Club logo

Comments (17)

jordanbyron avatar jordanbyron commented on July 26, 2024 1

👋 @mllocs and @brandoncc

I made this change on our fork and the net increase inside the heroku-20 stack build was +23.5 KB

betterup@dd2ab92

@brandoncc if that seems like an acceptable increase in size I'd be happy to submit a PR with the updated configuration and builds.

It might be worth pointing out that the libvips install guides flag the increased attack surface by including Imagemagick in the build.

ImageMagick, or optionally GraphicsMagick

If you are going to be using libvips with untrusted images, perhaps in a web server, for example, you should consider the security implications of enabling a package with such a large attack surface.

Source: https://libvips.github.io/libvips/install.html

from heroku-buildpack-vips.

jcupitt avatar jcupitt commented on July 26, 2024 1

libvips 8.12 has a new built-in GIF saver, so you no longer need imagemagick for this feature.

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on July 26, 2024 1

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on July 26, 2024

Thanks for opening this issue. I'll look into this and see if it looks doable. I don't have a problem doing this as long as it doesn't cause bloat. I'm not sure how much space usage libmagick introduces (the name is reminiscent of imagemagick which is what makes me wonder).

If you would like, you are welcome to fork the repo and add this to the build. Then we can compare the build sizes.

If you would rather I do the test, I'll try to work on it this weekend.

from heroku-buildpack-vips.

mllocs avatar mllocs commented on July 26, 2024

Thanks for the answer @brandoncc 🙂

I tried forking the repo and doing a new build installing imagemagick as a dependency (also updating to [email protected]) but I had no success, I still get the same error in Heroku when trying to convert gif images.

I suspect I didn't configure the build properly. JCupitt mentioned to add libmagick support but I'm not quite sure how to do that in the buildpack.

from heroku-buildpack-vips.

matthewford avatar matthewford commented on July 26, 2024

libvips 8.12 has a new built-in GIF saver, so you no longer need imagemagick for this feature.

Hi, thanks for this build pack, however I still see the original issue mentioned on libvips 8.12.1-Wed

from heroku-buildpack-vips.

jcupitt avatar jcupitt commented on July 26, 2024

Sorry, I misspoke, libvips has a new GIF saver, but it needs cgif for the actual encode. This should be added to the build and imagemagick removed.

https://github.com/dloebl/cgif

(cgif is only v0.2, but it's being used by quite a few large sites (like shopify), so (imo) it's fine)

libvips 8.12.1 didn't fall back to imagemagick correctly for GIF, but 8.12.2 fixes this.

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on July 26, 2024

Thank you for letting us know about that new GIF saver, John!

I'll work on adding this over the weekend.

Sorry for the delay on this issue, everyone.

from heroku-buildpack-vips.

matthewford avatar matthewford commented on July 26, 2024

Yeah, I had real trouble adding cgif via aptfile if anyone knows how please share the result.

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on July 26, 2024

@jcupitt I'm guessing that I need to add cgif to the build script, rather than just installing it on the server after the fact. Can you confirm that?

@matthewford if John confirms, then this is the reason. I'll build it with cgif this weekend (likely tomorrow).

from heroku-buildpack-vips.

jcupitt avatar jcupitt commented on July 26, 2024

Yes, you need to build from source (it's very simple) since cgif hasn't been packaged yet (as far as I know).

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on July 26, 2024

And just to push this verification a little further, it needs to be built/available during the build of libvips. Is that correct, John?

from heroku-buildpack-vips.

jcupitt avatar jcupitt commented on July 26, 2024

That's right -- check the messages from configure. I would add libspng as well, if you're revising this stuff. It's quite a bit faster and smaller than libpng.

I see:

...
PNG load/save with libspng:             yes
 (requires spng 0.7 or later)
PNG load/save with libpng:              no
 (requires libpng-1.2.9 or later)
selected quantisation package:          imagequant
...
GIF save with cgif:                     yes
 (requires cgif and a quantisation package)
...

You can use vips --vips-config after building to check all the configured packages.

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on July 26, 2024

You are the best, John. Thank you again.

from heroku-buildpack-vips.

matthewford avatar matthewford commented on July 26, 2024

Hi @brandoncc any chance of updating the buildpack? Many thanks.

from heroku-buildpack-vips.

matthewford avatar matthewford commented on July 26, 2024

@brandoncc happy to test if there is a branch/pr?

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on July 26, 2024

I'm sorry for the extremely long delay on this issue. Saving GIFs should work now https://github.com/brandoncc/heroku-buildpack-vips/blob/4d51d1cb1546ace27ccfd8aa928c017c2cfd4a3d/build/configurations/heroku-22.config.log#L38

If there is any further trouble, feel free to re-open the issue.

from heroku-buildpack-vips.

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.