GithubHelp home page GithubHelp logo

rofld's Introduction

rofl

Lulz on demand

Build Status Crates.io

What?

This is a joint repo for:

  • the rofld meme server (src/server)
  • the rofl crate which powers it (src/lib)
  • [WIP] the roflsh CLI application (src/cli)

Why?

To make memes, not war.

rofld's People

Contributors

xion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

izderadicka aleb

rofld's Issues

`cargo build` always rebuilds some crates needlessly

It is probably be a bug in Cargo but noting it here for posterity.

Rebuilding the library crate always triggers a rebuild of certain dependencies:

$ cargo build -p rofl                                                                                                   
   Compiling unreachable v0.1.1
   Compiling thread_local v0.3.3
   Compiling regex v0.2.2
   Compiling rofl v0.0.1 (file:///home/xion/Code/rofld/src/lib)
    Finished dev [unoptimized + debuginfo] target(s) in 23.69 secs

and more so for the server crate:

$ cargo build -p rofld
   Compiling unreachable v0.1.1
   Compiling thread_local v0.3.3
   Compiling slog-extra v0.1.2
   Compiling regex v0.2.2
   Compiling slog-stream v1.2.1
   Compiling slog-term v1.5.0
   Compiling slog-stdlog v1.1.0
   Compiling slog-envlogger v0.5.0
   Compiling rofl v0.0.1 (file:///home/xion/Code/rofld/src/lib)
   Compiling rofld v0.0.1 (file:///home/xion/Code/rofld/src/server)
    Finished dev [unoptimized + debuginfo] target(s) in 56.76 secs

This persists not only through cargo clean or nuking of Cargo.lock, but also apparently between machines AND systems (observed on OSX and Linux). The deps which are rebuilt needlessly are always the same.

It may have started happening with Rust 1.18 but not completely sure about that. In either case, it adds quite a bit to the already long build time :(

"Shrink" text mode

RIght now the meme text is always line-wrapped with a constant size. Sometimes wrapping is undesirable though, so the other mode to support would be to shrink the text (within reason) until it fits the line.

This would be a new per-caption setting, say:

pub enum Overflow { Wrap, Shrink }

Watch for new templates/fonts

In addition to --preload, --watch would set up an inotify subscription to automatically load & cache any templates/fonts put into relevant folders.

(--watch would not require --preload, but would imply it (for the same arguments) if used without & emit a warning).

Heads-up: UB due to misuse of mem::uninitialized will soon lead to panic

Here, this crate causes UB by "Producing an invalid value". Concretely, it produces a value of type VAlign with mem::uninitialized(), but enums must always be in one of their variants. In the near future the call to mem::uninitialized() will panic to avoid UB, and our crater run determined that this crate will be affected.

mem::uninitialized() is deprecated since Rust 1.39. The intended replacement is MaybeUninit, which tracks the possibility of uninitialized values at the type level to make sure the compiler does not make any false assumptions.

Investigate using `unicode-width`

The unicode-width crate determines the character width of Unicode strings, and should most likely be used for the line breaking algo. It's unclear if it can completely help with the clipping/overflowing issue we see sometimes, but it should at least allow to detect the invisible/zero-width characters more robustly.

https://crates.io/crates/unicode-width

Make a library

The part that does actual captioning of images is mostly independent from the rest of the binary. It could be made into a library crate and published on crates.io.

Improve line breaking

Basic line breaking is in, but it has the following problems:

  • it kinda doesn't support words that are longer than the line (they still get clipped); they should be broken up in some rudimentary way
  • it doesn't honor explicit line breaks
  • it doesn't preserve sequences of whitespace between words

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.