textpattern icon indicating copy to clipboard operation
textpattern copied to clipboard

RFC: would these third party libraries / helpers solve any problems?

Open petecooper opened this issue 1 year ago • 8 comments
trafficstars

https://github.com/Kalabasa/htmz https://leanrada.com/htmz/

This may be a tool looking for a problem that doesn't exist for us, but it's 166 bytes that might save some cruft elsewhere.

petecooper avatar Feb 19 '24 22:02 petecooper

Well, dang, that's a very neat tool. Can we use it, pretty please? Can we, can we?

Bloke avatar Feb 20 '24 00:02 Bloke

One more to consider - a PHP HTTP client (MIT):

https://github.com/guzzle/guzzle/

petecooper avatar Jun 03 '24 22:06 petecooper

Adding Imageflow to the list: https://github.com/imazen/imageflow

petecooper avatar Aug 14 '24 10:08 petecooper

libvips: https://github.com/libvips/libvips … and the associated PHP bindings: https://github.com/libvips/php-vips

libvips is a demand-driven, horizontally threaded image processing library. Compared to similar libraries, libvips runs quickly and uses little memory. libvips is licensed under the LGPL 2.1+.

petecooper avatar Aug 21 '24 10:08 petecooper

They forgot one important line:

libvips is also mahoosive.

:O

It's a 45MB download, uncompressed. And there's also this curious statement about integrating it with ImageMagick:

If available, libvips adds support for loading and saving all libMagick-supported image file types. You can enable and disable load and save separately... 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.

Is that in relation to their own tool or are they saying ImageMagick itself is potentially dangerous?!

I'd respectfully disregard this tool for Txp uses, unless you're thinking it would be useful for image processing on the demo server or docs or something?

Bloke avatar Aug 21 '24 10:08 Bloke

My take was rather more simplistic (perhaps overly so) - check if the server has libvips installed, use it…not literally packaging all the bits & pieces in our download. I haven't checked the size of the PHP bindings, that could be prohibitive.

petecooper avatar Aug 21 '24 12:08 petecooper

Ah right, okay. Their API seems radically different to standard libraries that offer transforms and their list of operations include stuff we'd simply have no need for: colour-profile switching, bandwise image joining, fractal surfaces, histograms, pick most significant byte from image(?), ...

The php-vips library isn't too onerous (about 1MB) and I haven't grokked it yet so it might be worth a look if it adds anything we can use.

Bloke avatar Aug 21 '24 13:08 Bloke

I have no attachment to it, to be honest - just laying it out as a potential. The src part of php-vips runs to about 300kB or so.

petecooper avatar Aug 21 '24 13:08 petecooper