Skip to content

Commit

Permalink
Clean up RMagick setup, hopefully fixing the build.
Browse files Browse the repository at this point in the history
We include RMagick system-wide now since it's getting used in more and more components.
  • Loading branch information
bamnet committed Mar 7, 2012
1 parent 12f1ef0 commit a9f9a58
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gem 'sqlite3'
# gem 'jbuilder'

#RMagick is used for image resizing and processing
gem "rmagick", ">= 2.12.2"
gem "rmagick", ">= 2.12.2", :require => 'RMagick'

# Attachable does all the file work.
gem 'attachable', '>= 0.0.2'
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ def destroy
# GET /template/1/preview
# Generate a preview of the template based on the request format.
def preview
require 'RMagick'

@template = Template.find(params[:id])
@media = @template.media.original.first
@image = Magick::Image.from_blob(@media.file_contents).first
Expand Down
2 changes: 0 additions & 2 deletions app/models/graphic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ def render(options={})
# In theory, there should be more code in here to look for a cached image and be smarter
# about the resizing, but this is a good first pass.
if options.key?(:width) && options.key?(:height)
require 'RMagick'

image = Magick::ImageList.new
image.from_blob(@media.file_contents)
image.resize!(options[:width].to_i, options[:height].to_i)
Expand Down

0 comments on commit a9f9a58

Please sign in to comment.