Commit graph

16 commits

Author SHA1 Message Date
adroitwhiz
3de4858b5a
Clean up image API code paths (#49)
* Document image.js a bit

* Close image.js sockets in all code paths

I'm not sure whether sockets get GC'd when the function returns

* Remove getFormat

It was only called from one place, and the object property names were
quite confusing

* Clean up image.js conditional a bit

I had to write out an entire truth table for this and work it all out
Thinking hard

* Move actual ImageMagick calling into separate file

This gets rid of the weird, brain-melting ouroboros of code that
recurses across threads and processes.

* Reduce amount of getType wrangling

This amounted to an awful lot of dead conditionals after the image
commands were all modified to pass in image types anyway. This has also
led to two different implementations diverging, which causes bugs like
GIF commands applied to non-GIFs erroring instead of providing a
user-friendly message.

* Unify image-runner return type, clarify image type

This allows us to remove the fromAPI parameter from image-runner, and
helps greatly clarify the behavior around image types.

* Deduplicate GIF code, fix "not a GIF" handling

The special "nogif" value is now stored as the image type instead of its
value, as the value must always be a Buffer now--no loosely-typed
shenanigans.
2021-01-09 19:50:29 -06:00
9f2bd1fecb Make the bot itself get the image file type again 2021-01-04 20:53:34 -06:00
a03d3a5e79 Fixed GIF commands for real (lol) 2020-10-19 20:24:53 -05:00
cf5c649384 Heavy work on the image detection code, fixed mention prefixes not being properly registered 2020-10-18 16:53:35 -05:00
ac4e1f5dd8 Simplified and fixed image API, updated packages 2020-10-06 14:48:22 -05:00
f415b3bb09 Changed image function syntax, improved dice, switched to fs.promises, might have also done other stuff but idk 2020-08-27 21:34:12 -05:00
e860aee986 Even more Magick++ ports 2020-07-22 19:54:58 -05:00
f6425dc294 Refactored image/embed handling to prepare for something, don't use fuzz with sonic 2020-04-12 14:51:48 -05:00
56b382fce3 Fixed error when there are no more frames to remove in speed 2020-04-03 17:51:05 -05:00
6dfba281ef Fixed gifvs not having proper delay 2020-03-15 12:54:51 -05:00
5455b2682c Removed duplicate type parameter, made image commands use a promisified version of the default toBuffer method 2020-02-25 14:45:47 -06:00
1e259ab312 Removed node version check, promisified many gm calls 2020-02-20 18:26:49 -06:00
328d36d1ea Added -layers optimize to every image command 2020-02-20 08:22:05 -06:00
e2a32a8c89 One of the commits from a few days ago was a mistake 2020-02-19 08:25:45 -06:00
777b86e480 Added support for "gifv"s, fixed embed issue with image 2020-02-18 14:44:39 -06:00
32bef7f815 Added motivate and speed 2020-02-13 13:29:42 -06:00