Giter Club home page Giter Club logo

Comments (9)

brandoncc avatar brandoncc commented on August 31, 2024

Hi John,

Thank you for letting me know about this. I will do it over the weekend.

from heroku-buildpack-vips.

jcupitt avatar jcupitt commented on August 31, 2024

Hi again, I spent some time fixing up that Dockerfile I made a while back:

https://github.com/jcupitt/docker-builds/tree/master/libvips-heroku18

It seems to all work. You end up with a 4MB tarball which runs on a bare heroku 18 image and supports most file formats, including PDF. If you drop PDF support, it goes down to 1.5MB.

Hopefully this can copy-paste in a pretty simple way into your build pack. It works with heroku 20 too, I've not tried any others.

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on August 31, 2024

Thanks for the update, John.

I'm wondering what the ramifications of switching from poppler to PDFium would be. I seem to remember that a long time ago I had some image "ghosting" issues and it was related to the PDF renderer that was being used. I remember it was the same engine that is used by Firefox. Would that be poppler or PDFium? I use the PDF capabilities of vips very heavily, so I am hesitant to make that change in the buildpack...

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on August 31, 2024

libvips/libvips#1230

I found the issue here.

Are you aware of any differences in how PDF loading works between poppler and PDFium that I should be aware of? I'm still hesitant, but less so since the issue above involved poppler which the buildpack currently still uses.

from heroku-buildpack-vips.

jcupitt avatar jcupitt commented on August 31, 2024

Hi again, here's my understanding of the pros and cons:

  • Robustness pdfium is the PDF reader that's built into Chrome, so it's extremely well tested and safe. Poppler is fuzzed too, but not to the same extent. The (maybe?) slight weak point is the libvips / pdfium link, since we don't fuzz that specific bit of code at the moment. I'll add it to the libvips fuzz package.
  • Compliance Again, being Chrome's PDF reader means that pdfium ought to have excellent standards compliance. Though I don't actually know of any specific cases that pdfium handles better.
  • Performance Pretty similar, both speed and memory use. You'll find some PDFs are faster with one and some faster with the other.
  • Licence This is the largest difference: poppler is GPL3 and pdfium is MIT. All rails programs using the poppler buildpack are probably gpl3, maybe accidentally.
  • Threading Poppler lets two threads render two separate PDFs at the same time, but pdfium is very, very single-threaded: only one thread may do any pdf rendering at any one time (this is because of its origins as the FoxIt Windows desktop PDF previewer and won't be fixed, unfortunately). I don't know if this has performance implications, it depends on the threading model used by rails.

In my opinion it's a change worth making for the robustness and the much more liberal licence, but it's certainly debatable and I can see people taking the opposite view.

from heroku-buildpack-vips.

jcupitt avatar jcupitt commented on August 31, 2024

I remember it was the same engine that is used by Firefox.

I think FF uses their own PDF previewer written in javascript. Chrome uses pdfium, derived from FoxIT, that they've open-sourced under the MIT licence. Poppler derives from the old Unix xpdf desktop previewer.

from heroku-buildpack-vips.

jcupitt avatar jcupitt commented on August 31, 2024

... adding pdfium to the libvips fuzzer: google/oss-fuzz#7336

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on August 31, 2024

Thank you again, John. I finally had time to get all of the open PRs taken care of, so this is my next item to handle.

from heroku-buildpack-vips.

brandoncc avatar brandoncc commented on August 31, 2024

This is finally done 👍

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.