Coder Social home page Coder Social logo

letter_avatar's People

Contributors

aafaq-hassan avatar aidewoode avatar dreamersoul avatar eric-guo avatar gaolei avatar huacnlee avatar kbackowski avatar ksz2k avatar nerdenberger avatar snow avatar zacharywelch 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  avatar  avatar  avatar

letter_avatar's Issues

`LetterAvatar.resize` increased bytesize of avatar file under certain environment

with ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31, ubuntu 16.04.3 LTS

LetterAvatar.execute(
generates fullsize (240px) files at around 5kb

but after

I got files at aroud 50kb regardless value of pixel size.

with imagemagick: stable 7.0.7-28, macOS 10.13.3, LetterAvatar.resized files reminded under 10kb.

So I think it may be an issue with ImageMagick.

I'm not very good at English so sorry if there are any English syntax error.

Remove ImageOptim will avoid complex dependencys

I saw the main feature just execute ImageMagick convert to generate image.

But in README file you said:

sudo apt-get install -y advancecomp gifsicle jhead jpegoptim libjpeg-progs optipng pngcrush pngquant

The install way looks like tooooo hard.

If you remove ImageOptim, it will easily.

Doesn't it support utf-8 character ?

Hi @ksz2k, thanks for your share first. when i try it , i meet a problem about utf-8 character generating.

Test Case: LetterAvatar.generate "宋佳洋", 200
Result: 40

Does it really support or my ImageMagic version problem?

Version: ImageMagick 6.8.9-7

include Letter::Avatar Throwing Uninitialized Constant Error

Howdy
I am using Rails 5.0.4

LetterAvatar.generate 'ksz2k', 200 is working just fine. (This is what I get in the rails console)

[2] pry(main)> LetterAvatar.generate 'ksz2k', 200
=> "public/system/lets/letter_avatars/2/K/87_178_230/200.png"

However when trying to use the HasAvatar helper I get the following error

[4] pry(main)> LetterAvatar::HasAvatar
NameError: uninitialized constant LetterAvatar::HasAvatar

Any ideas on what could be going on here?

mattr_accessor is defined in ActiveSupport but the dependency is not stated

Since I would like to avoid the dependency on AS, let's rewrite the code to not depend on AS.

> require 'letter_avatar'
NoMethodError: undefined method `mattr_accessor' for LetterAvatar:Module
    from /home/vagrant/.gem/ruby/gems/letter_avatar-0.1.7/lib/letter_avatar.rb:7:in `<module:LetterAvatar>'
    from /home/vagrant/.gem/ruby/gems/letter_avatar-0.1.7/lib/letter_avatar.rb:5:in `<top (required)>'
    from (irb):2:in `require'
    from (irb):2
    from /usr/bin/irb:11:in `<main>'

Inconsistent letter size on different environments

This is my initializer:

LetterAvatar.setup do |config|
    config.fill_color        = 'rgba(255, 255, 255, 0.65)' # default is 'rgba(255, 255, 255, 0.65)'
    config.cache_base_path   = 'public/system/ava'     # default is 'public/system'
    config.colors_palette    = :iwanthue                # default is :google
    config.weight            = 96                      # default is 300
    config.annotate_position = '-0+5'                  # default is -0+5
    config.letters_count     = 2                        # default is 1
    config.pointsize         = 140                       # default is 140
end

And this is how I generate avatar:

LetterAvatar.generate name, 96

And this is the result for dev and prod:

image

I have no idea whey production makes letters almost invisible and tiny. Any idea?

Update:

If I gave weight 500 and pointsize 200 this happens in dev and prod:

image

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.