Permalink
Browse files

remove unused features

  • Loading branch information...
1 parent 4a26e22 commit 36bd3bedf8ff7cd1c73da573b823859cda134ae2 @ghostganz ghostganz committed Mar 15, 2012
Showing with 2 additions and 74 deletions.
  1. +0 −51 lib/imageproxy/convert.rb
  2. +0 −13 lib/imageproxy/identify.rb
  3. +2 −10 lib/imageproxy/server.rb
View
@@ -56,56 +56,5 @@ def execute(user_agent=nil, timeout=nil)
ConvertedImage.new(image.to_blob, response.headers)
end
-
- #def convert_options
- # convert_options = []
- # convert_options << "-resize #{resize_thumbnail_options(options.resize)}" if options.resize
- # convert_options << "-thumbnail #{resize_thumbnail_options(options.thumbnail)}" if options.thumbnail
- # convert_options << "-flop" if options.flip == "horizontal"
- # convert_options << "-flip" if options.flip == "vertical"
- # convert_options << rotate_options if options.rotate
- # convert_options << "-colors 256" if options.format == "png8"
- # convert_options << "-quality #{options.quality}" if options.quality
- # convert_options << interlace_options if options.progressive
- # convert_options.join " "
- #end
- #
- #def resize_thumbnail_options(size)
- # case options.shape
- # when "cut"
- # "#{size}^ -gravity center -extent #{size}"
- # when "preserve"
- # size
- # when "pad"
- # background = options.background ? %|"#{options.background}"| : %|none -matte|
- # "#{size} -background #{background} -gravity center -extent #{size}"
- # else
- # size
- # end
- #end
- #
- #def rotate_options
- # if options.rotate.to_f % 90 == 0
- # "-rotate #{options.rotate}"
- # else
- # background = options.background ? %|"#{options.background}"| : %|none|
- # "-background #{background} -matte -rotate #{options.rotate}"
- # end
- #end
- #
- #def interlace_options
- # case options.progressive
- # when "true"
- # "-interlace JPEG"
- # when "false"
- # "-interlace none"
- # else
- # ""
- # end
- #end
- #
- #def new_format
- # options.format ? "#{options.format}:" : ""
- #end
end
end
View
@@ -1,13 +0,0 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), "command")
-
-module Imageproxy
- class Identify < Imageproxy::Command
- def initialize(options)
- @options = options
- end
-
- def execute(user_agent=nil)
- execute_command %'#{curl @options.source, :user_agent => user_agent} | identify -verbose -'
- end
- end
-end
View
@@ -32,7 +32,8 @@ def call(env)
check_domain options
check_size options
- converted_image = convert_file(options, user_agent)
+ converted_image = Convert.new(options).execute(user_agent, config(:timeout))
+
image_blob = converted_image.image_blob
raise "Empty image file" if image_blob.empty?
@@ -47,11 +48,6 @@ def call(env)
end
[200, headers, StringIO.new(image_blob)]
- when "identify"
- check_signature request, options
- check_domain options
-
- [200, {"Content-Type" => "text/plain"}, [Identify.new(options).execute(user_agent)]]
when "selftest"
[200, {"Content-Type" => "text/html"}, [Selftest.html(request, config?(:signature_required), config(:signature_secret))]]
else
@@ -72,10 +68,6 @@ def transformation_checksum(options)
Digest::MD5.hexdigest(buffer)[0..8]
end
- def convert_file(options, user_agent)
- Convert.new(options).execute(user_agent, config(:timeout))
- end
-
def config(symbol)
ENV["IMAGEPROXY_#{symbol.to_s.upcase}"]
end

0 comments on commit 36bd3be

Please sign in to comment.