-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a meme generator extension #93
Comments
The trivial script at https://github.com/vquaiato/memish/blob/master/memish.sh looks like a good starting point. If it's that simple, then there's probably no need to use the imagemagick api (except maybe to accelerate things a little bit). |
We'll have some fun with this one. It will be especially useful in the presentations. Anything we can do to save a few clicks goes a long way. |
Played around with imagemagick a bit. The following bit of Ruby pseudo code should do the trick for a first implementation
|
Would it be possible to use rmagick if it's available and fall back to the
convert cli if not? This would be a silent choice.
|
Definitely, but it probably wouldn't make much difference performance wise (except perhaps on Windows where process creation is a bit slower). |
Amazing! 🍻 |
I agree. It's more about abstraction and keeping things self-contained where possible. I've used rmagick with success in the past. |
Presentations worldwide just got crazy. |
I'm thinking the background should be the target, since it's the foundation of the meme. You could also make top and bottom positional attributes:
caps could be an option to make typing simpler:
We could use a convention of two spaces to represent a line break:
or we could recognize a double forward slash offset by spaces (or maybe either or)
line separator could even be an attribute
wdyt? |
Maybe instead of opts=caps we could do case=upper (vs case=lower). |
opts=upper, that's definitely one I'm going to add. Positional attributes, good suggestion. The less clutter the better. I'm not sure how that's going to interact with the existing positional attributes that are already support (target and format are 0 and 1 for all extension at the moment), but I'll figure something out. ' // ' instead of '\n', also a good one. I'm passing the string directly to imagemagick at the moment which is why it's like that now. You're suggestion is definitely more readable. RMagick, not sure about that yet. I would have to implement and test two code paths. The CLI variant is easier for people to get up and running I think. The only downside is that I'm currently dependant on ImageMagick. I tried real quick with GraphicsMagick, but that doesn't seem to support text auto sizing feature that ImageMagick does (or at least not with the same CLI arguments). To be continued tomorrow. I've made a feature branch and pushed my WIP if you want to give it try already. |
#93 Remove should_process? in ditaa extension
I had a look at RMagick. Using it would avoid spawning a bunch of sub processes, but that would be the only benefit. RMagick 2 doesn't support GraphicsMagick anymore, so there's little abstraction benefit anymore. It's still also a non-FFI native extension that doesn't ship with precompiled binaries. That makes it hard to install for non-developers and difficult to use in anything but MRI. |
I ended up adding 'noupcase' as the option rather than 'upper'. Upper case feels like a better default for meme images. |
I got the generator working under JRuby by using Open3s capture3 instead of capture2e. |
Merged in fbcf92e |
@timofonic not sure what you're asking here. The meme extension is already implemented. It currently depends on the imagemagick |
Just for fun add a meme generator extension. See asciidoctor/asciidoctor-extensions-lab#8 for discussion.
meme_captain looks like a good starting point for this. The only downside is that it requires RMagick which is a native extension and as a consequence a bit of a pain to install for many users. One alternative might be to investigate if this is feasible using the command line imagemagick tools as well.
The text was updated successfully, but these errors were encountered: