![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Dragonfly is a Rack framework for on-the-fly image handling.
Ideal for using with Ruby on Rails (2.3 and 3), Sinatra and all that gubbins.
Gemfile:
gem 'rack-cache', :require => 'rack/cache'
gem 'dragonfly', '~>0.8.2'
Initializer (e.g. config/initializers/dragonfly.rb):
require 'dragonfly/rails/images'
Migration:
add_column :albums, :cover_image_uid, :string
Model:
class Album < ActiveRecord::Base
image_accessor :cover_image # 'image_accessor' is provided by Dragonfly
# this defines a reader/writer for cover_image
# ...
end
View (for uploading via a file field):
<% form_for @album, :html => {:multipart => true} do |f| %>
...
<%= f.file_field :cover_image %>
...
<% end %>
NB: REMEMBER THE MULTIPART BIT!!!
View (to display):
<%= image_tag @album.cover_image.url %>
<%= image_tag @album.cover_image.thumb('400x200#').url %>
<%= image_tag @album.cover_image.jpg.url %>
<%= image_tag @album.cover_image.process(:greyscale).encode(:tiff).url %>
...etc.
The above relies on imagemagick being installed. Dragonfly doesn't depend on it per se, but the default configuration 'dragonfly/rails/images'
uses it. For alternative configurations, see below.
If using Capistrano with the above, you probably will want to keep the cache between deploys, so in deploy.rb:
namespace :dragonfly do
desc "Symlink the Rack::Cache files"
task :symlink, :roles => [:app] do
run "mkdir -p #{shared_path}/tmp/dragonfly && ln -nfs #{shared_path}/tmp/dragonfly #{release_path}/tmp/dragonfly"
end
end
after 'deploy:update_code', 'dragonfly:symlink'
Dragonfly is primarily a Rack app, so you can use it as a standalone app, or with Sinatra, Merb, etc.
It's highly customizable, and works with any data type (not just images).
For more info, consult the DOCUMENTATION
For third-party add-ons, see the Add-ons wiki
Please use the github issue tracker if you have any issues.
Copyright (c) 2009-2010 Mark Evans. See LICENSE for details.
FAQs
Unknown package
We found that oahu-dragonfly demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.