GithubHelp home page GithubHelp logo

sggts04 / dankcli Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 5.0 242 KB

CLI Image Captioning Tool or Meme Generator which automatically adds whitespace and text to top

Home Page: https://pypi.org/project/dankcli/

License: MIT License

Python 100.00%
cli dankcli dankmemes generator memes pillow python python3

dankcli's People

Contributors

dhdavvie avatar pyroseza avatar sggts04 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

Watchers

 avatar  avatar  avatar

dankcli's Issues

output image is massively bloated compared to input image

When I run the program, I choose a JPG image of 905KB and add a single line to it, the output file type changes to PNG and is 8.3MB in size.

Here's my command:
python -m dankcli "84890886.jpg" "When you finally make your first meme, time to take over the world"

Input image
84890886

Output image
meme1

TypeError: cannot unpack non-iterable PngI/Jpg/JpegImageFile object

Describe the bug
When trying to use dankcli with different images and image-types I get the error TypeError: cannot unpack non-iterable Png/Jpg/JpegImageFile object. It happens with jpg, png and jpeg.

To Reproduce
Exact stuff you did:
Used command (with jpg as example) was:
python3 -m dankcli "/home/user/pictures/dankpic.jpg" "When you make a meme" -f "dankcreation"

Expected behavior
Expected a "completed"/working output

Setup in which bug happened:

  • OS
    Arch Linux
  • Which command line/ terminal used(sometimes cmd on windows can be problematic)
    Konsole/fish

Additional context
No further context as probably not useful. If additional steps/information is needed feel free to ask me.

Mac font issue

Describe the bug
Tried to use this and ran into the error below:

python -m dankcli flower.jpg "When I make a function"
Traceback (most recent call last):
  File "/usr/local/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/dankcli/__main__.py", line 31, in <module>
    font = ImageFont.truetype('fonts/arial.ttf', size=getFontSize(img))
  File "/usr/local/anaconda3/lib/python3.7/site-packages/PIL/ImageFont.py", line 280, in truetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/PIL/ImageFont.py", line 145, in __init__
    layout_engine=layout_engine)
OSError: cannot open resource

To Reproduce
Exact stuff you did:
I'm in the Downloads folder where the image is stored (flower.jpg)
2. Exact command typed
python -m dankcli flower.jpg "When I make a function"
python -m dankcli "~/Downloads/flower.jpg" "When I make a function"

Expected behavior
I expected to get an image with text on top

Setup in which bug happened:

  • OS newest MacOS
  • Which command line/ terminal used(sometimes cmd on windows can be problematic)
    python -m dankcli flower.jpg "When I make a function"

Two features: Black background and white text and better names for the images saved

Is your feature request related to a problem? Please describe.
I am frustrated by the names of pictures saved. Also, an option to have black background with white or colorful text would be cool.

Describe the solution you'd like
A better way of naming would be original name of file + " meme". If multiple memes of the same template are made, then (1),(2) and so on can be added. For the second one, the option to switch colors of text could be a option you add like -black

Describe alternatives you've considered
To make dark text, Doing python -m dankcli "image.png" " " and then coloring the white part and adding text with paint.net or anything really. For the naming I haven't been able to come up with something. The names are so bizarre.

Font Size problems

Sometimes font size is too big in long height but small width photos and is too small in very small height but long width photos and

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.