Coder Social home page Coder Social logo

elixir_poster's Introduction

ElixirPoster

For a detailed rundown of why this project exists, please ready Build Your Own Code Poster with Elixir. The general idea was to create a commits.io style poster for a client of mine.

During that processes, I decided to make an Elixir poster as well, to celebrate the language I wrote to build the tool.

Warning

Take this tool for what it is. It's a utility I hacked together to generate a one-off poster specifically for my needs. It's not a general purpose poster making tool, and may not work for your use case.

I've published this repo as a learning tool and as a supplement to this article. It is not intended to be a quality piece of standlone software.

Read below if you're still intent on giving it a spin:

Instructions

This is an Elixir project. You'll need Elixir installed before running this application. Check out the Elixir Introduction for help getting up to speed. Once you've got Elixir up and running, and cloned this project locally, proceed to the following steps.

  1. Scale an image of your choosing to 1.667x1 and resize to approximately 398px by 300px. As an example, here’s the image I used to generate the Elixir poster.
  2. Gather the source code you want to use in the poster into a single file.
  3. From the project root, start an interactive shell (iex -S mix)
  4. Call the ElixirPoster.go function. By default, this assumes that your image is called image.png, and your source file is called code in the root of the project. These options can be overridden, if desired. See the ElixirPoster.go definition.
  5. On my machine, with the given source image, it takes approximately 3 seconds to generate the final poster. The final result is an SVG saved to out.svg.
  6. Open out.svg in Inkscape, export to PNG, print!

Simpler Instructions

  1. Put any code you want used in a file code
  2. Put the logo of your choosing in a file, image.png
  3. mix deps.get
  4. iex -S mix
  5. ElixirPoster.go

elixir_poster's People

Contributors

pcorey avatar robawilkinson avatar techgaun 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

elixir_poster's Issues

Stuck in Infinite loop.

I am trying to use it with some snippet of code and elixir logo. Its stuck in some infinite loop. will be good to know if code should be in particular format or language. how big should be the code file?

[documentation] Further enhance readme

As a non-elixir user, I'm unable to reason about the setup instructions in order to run this. Would you be able to further describe the file setup as it pertains to dependencies to assist me in running my first elixir project?

Looks great, excited to make my very own poster! 🎨 πŸŽ‰

Error with the example image?

I get the following error when trying to generate with my own code, but the example image mentioned in the README:

iex(1)> ElixirPoster.go

12:54:50.071 [debug] Loading code from './code'...

12:54:50.082 [debug] Joining code...

12:54:56.629 [debug] Loading image from './image.png'...

12:54:56.629 [debug] Skipping unknown header cHRM
** (UnicodeConversionError) invalid encoding starting at <<245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, ...>>
    (elixir) lib/list.ex:906: List.to_string/1
    (elixir) lib/enum.ex:1940: Enum."-join/2-lists^foldl/2-0-"/3
    (elixir) lib/enum.ex:1940: Enum.join/2
    lib/imagineer/image/png/compression/zlib.ex:27: Imagineer.Image.PNG.Compression.Zlib.decompress/1
    lib/imagineer/image/png/compression.ex:14: Imagineer.Image.PNG.Compression.decompress/1
    lib/imagineer/image/png/data_content.ex:12: Imagineer.Image.PNG.DataContent.process/1
    lib/imagineer.ex:27: Imagineer.detect_type_and_process/1
    (elixir_poster) lib/elixir_poster.ex:59: ElixirPoster.load_image/1

Where u able to repliacte with any other picture than the elixir one?

Hey there playing around with this little tool and it works fine with the provided elixir png.
Tried a couple of other images just for the fun but all of them have the text offset and overlapping. I made them in correct size and scaling as described. Also the color is just always blue.
As said the elixir example works perfectly, so everything seems to be setup corret.

Could it be that the exif information are needed in a certain way so Imagineer can loads the image correct?
While saving the png with gimp I recognized that there are basically no metadata information but the elixir example has quite a lot.

Here is and example png that I tried.
ruby_input

Any idea or hints?

error in iex

I'm new to Elixir, but couldn't find any help via googling. I've got code and image.png in my directory, but when I follow the README I get:

[computer elixir_poster (master)]$ mix deps
* apex 0.3.7 (Hex package) (mix)
  locked at 0.3.7 (apex) 0e4b39ff
  ok
* xml_builder 0.0.9 (Hex package) (mix)
  locked at 0.0.9 (xml_builder) 68f336e8
  ok
* imagineer 0.2.1 (Hex package) (mix)
  locked at 0.2.1 (imagineer) b426707d
  ok
[computer elixir_poster (master)]$ iex -S mix
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (1.4.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> ElixirPoster.go

11:20:08.152 [debug] Loading code from './full_elixir_source'...
** (File.Error) could not read file "./full_elixir_source": no such file or directory
           (elixir) lib/file.ex:244: File.read!/1
    (elixir_poster) lib/elixir_poster.ex:51: ElixirPoster.load_code/1
    (elixir_poster) lib/elixir_poster.ex:134: ElixirPoster.go/6

Any suggestions would be welcome!

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.