bjedrocha / avatar_magick Goto Github PK
View Code? Open in Web Editor NEWA Dragonfly plugin for creating Gmail style avatars
Home Page: http://bjedrocha.com/avatar_magick/
A Dragonfly plugin for creating Gmail style avatars
Home Page: http://bjedrocha.com/avatar_magick/
When following the tutorial on: http://markevans.github.io/dragonfly/rails to allow a user to upload a photo for a model, I get this error: undefined method 'avatar_size=' for #<User:0x007fe56740aac0>
.
Happens when trying to update the attributes:
def update
@user = User.find(params[:id])
if @user.update_attributes(update_user_params)
redirect_to users_path
else
render 'edit'
...
The params are:
def update_user_params
params.require(:user).permit(:avatar)
end
Disabling the concern fixes the issue... Any ideas why?
The text looks to get clipped at the top of the glyphs. Using font: 'Helvetica-Bold' but I see this with other fonts as well. Also the text doesn't look to be quite vertically centred... looks a little too high.
Dragonfly: 1.1.5
Avatar Magick version: 1.0.2
ImageMagick version:
Version: ImageMagick 7.0.7-28 Q16 x86_64 2018-03-25 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
Adds font_size as a param. If unset, the default size is the same as before.
I have Dragonfly setup on Heroku to use S3. Adding this gem reports the following error when trying to run:
DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '48' '-font' 'Helvetica' '-fill' '#FFFFFF' '-background' '#f57f17' 'label:AC' '/tmp/dragonfly20170224-6-3eai6x.png')
with exit status 1 and stderr convert.im6:
no images defined `/tmp/dragonfly20170224-6-3eai6x.png' @ error/convert.c/ConvertImageCommand/3044.
I'm working on developing a avatar_magick rails app that was working good with deployment method capistrano, and now i've changed deployment method to phusionpassenger.
Now no image is loaded. When I access the image link I get the error 500 internal server error.
What is causing this issue? Here's the stacktrace of the error.
W, [2017-04-26T20:18:36.364591 #17575] WARN -- : [43525c93-c9e7-4496-a20d-401cdc58cc17] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '42' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#546e7a' 'label:IEC' '/tmp/dragonfly20170426-17575-10zie6l.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.367442 #16597] WARN -- : [7ba3461b-b72d-4879-aee4-a653e7e15268] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '64' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#1e88e5' 'label:IT' '/tmp/dragonfly20170426-16597-1uzs2on.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.371409 #17575] WARN -- : [8a3c2c19-f4a9-42e4-9ba1-9c330c5188a4] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '42' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#311b92' 'label:MDS' '/tmp/dragonfly20170426-17575-np3qkt.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.372581 #16597] WARN -- : [b6083fe5-f628-4f80-9867-3deb845b2741] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '64' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#ffb300' 'label:GA' '/tmp/dragonfly20170426-16597-1v6ujoa.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.376203 #17575] WARN -- : [a369486e-0929-4090-a08f-c2c544d54023] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '64' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#212121' 'label:SR' '/tmp/dragonfly20170426-17575-nvus7y.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.379422 #16597] WARN -- : [9c29275a-c35f-4a07-93cc-7ce5d80ba628] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '64' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#1a237e' 'label:GT' '/tmp/dragonfly20170426-16597-y6hc3a.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.383431 #17575] WARN -- : [9a1573be-4877-4fbc-8239-3964053491ef] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '42' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#00897b' 'label:FPE' '/tmp/dragonfly20170426-17575-15luoim.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.384616 #16597] WARN -- : [f2adfe7f-95dd-4bee-ae41-6ff60bb00e3f] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '42' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#f57f17' 'label:ETL' '/tmp/dragonfly20170426-16597-1ff7ccb.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.387877 #17575] WARN -- : [4ea4690e-57d8-49e0-a092-0a9fc7ab7674] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '42' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#4a148c' 'label:CVA' '/tmp/dragonfly20170426-17575-deu9n3.png') with exit status 127 and stderr sh: 1: convert: not found
F, [2017-04-26T20:18:36.388965 #17575] FATAL -- : [5b2abd61-0757-4086-85c6-50d32c33488f]
F, [2017-04-26T20:18:36.389053 #17575] FATAL -- : [5b2abd61-0757-4086-85c6-50d32c33488f] ActionController::RoutingError (No route matches [GET] "/avatar/128/01579b/VALEBRAS%20PROD.CONSTR.%20CIVIL%20LTDA"):
F, [2017-04-26T20:18:36.389083 #17575] FATAL -- : [5b2abd61-0757-4086-85c6-50d32c33488f]
F, [2017-04-26T20:18:36.389114 #17575] FATAL -- : [5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/middleware/debug_exceptions.rb:53:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/rack/logger.rb:36:in `call_app'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/rack/logger.rb:24:in `block in call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_support/tagged_logging.rb:69:in `block in tagged'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_support/tagged_logging.rb:26:in `tagged'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_support/tagged_logging.rb:69:in `tagged'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/rack/logger.rb:24:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/middleware/request_id.rb:24:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/rack-2.0.1/lib/rack/method_override.rb:22:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/rack-2.0.1/lib/rack/runtime.rb:22:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/dragonfly-1.0.12/lib/dragonfly/cookie_monster.rb:9:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/middleware/executor.rb:12:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.2/lib/action_dispatch/middleware/ssl.rb:84:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine.rb:522:in `call'
[5b2abd61-0757-4086-85c6-50d32c33488f] /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
[5b2abd61-0757-4086-85c6-50d32c33488f] /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request'
[5b2abd61-0757-4086-85c6-50d32c33488f] /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
[5b2abd61-0757-4086-85c6-50d32c33488f] /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
[5b2abd61-0757-4086-85c6-50d32c33488f] /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
W, [2017-04-26T20:18:36.391432 #16597] WARN -- : [b077eb68-8d44-4de9-a42a-fe126f94b3e1] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '42' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#1a237e' 'label:OTL' '/tmp/dragonfly20170426-16597-8kzlpl.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.395850 #17575] WARN -- : [fbd8bb69-8dab-4737-8779-3adff60d6d59] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '42' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#00acc1' 'label:OCE' '/tmp/dragonfly20170426-17575-u8zaso.png') with exit status 127 and stderr sh: 1: convert: not found
W, [2017-04-26T20:18:36.396310 #16597] WARN -- : [108183ef-5ca8-46c3-bbf6-611d38e6d343] DRAGONFLY: caught error - Command failed ('convert' '-gravity' 'none' '-antialias' '-pointsize' '42' '-font' 'Arial-Regular' '-fill' '#FFFFFF' '-background' '#33691e' 'label:DST' '/tmp/dragonfly20170426-16597-13cl66q.png') with exit status 127 and stderr sh: 1: convert: not found
This is my code config\initializers\dragonfly.rb
:
require 'dragonfly'
Dragonfly.app.configure do
plugin :imagemagick
plugin :avatarmagick
secret "my-secret"
url_format "/media/:job/:name"
datastore :file,
root_path: Rails.root.join('public/system/dragonfly', Rails.env),
server_root: Rails.root.join('public')
end
Dragonfly.logger = Rails.logger
Rails.application.middleware.use Dragonfly::Middleware
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.