Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
HamptonMakes committed Oct 12, 2010
2 parents 99fcb46 + bb08a91 commit 166bd8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG
@@ -1,8 +1,9 @@
* October 12, 2010 - Added support for loading images from external sources (HTTP/FTP). [cleon]
* August 28, 2010 - Just quote all arguements now.
* August 24, 2010 - Closing an issue with quoting colors... Issue #11 [hcatlin]
* August 17, 2010 - Added compositing! [hcatlin]
* August 17, 2010 - Moved a lot of the command logic into the CommandBuilder. This way, we don't have to repeat things like checking to see if a MOGRIFY_COMMAND is valid or not. Also added some new tests for some behaviour I noticed that wasn't specifically being tested for. Depricated the "+" method as the API was clunky. Moved to "<<" with slightly different behaviour. Image.new(path) no longer throws an error if the 'path' isn't valid. Allows us to create new images (copies, etc), however Image.open(path) will throw an Invalid error if the file stinks. Please use valid? if you want to find out if an image is recognized. [hcatlin]
* August 17, 2010 - Merged in changes to allow subexec to run on 1.8.7.
* August 16, 2010 - Merged in a bugfix change from kepi that makes 'dashed' commands (like "auto-correct") work well with the method_missing overrides. I made some changes to that patch that included simplifying the tests and also decreasing the size of the test images again. Sorry cute cats.... but your bits aren't needed!
* July 29, 2010 - Made the test images much, much smaller. Now, the size of the gem has gone from 1,080kb to 68kb. Should save a bunch of bandwidth with bundler deploys. [hcatlin]
* July 29, 2010 - Merged in my changes to allow it to work under 1.8. subex is only used in 1.9.2.
* July 29, 2010 - Merged in my changes to allow it to work under 1.8. subex is only used in 1.9.2.
11 changes: 11 additions & 0 deletions lib/mini_magick.rb
@@ -1,5 +1,6 @@
require 'tempfile'
require 'subexec'
require 'open-uri'

module MiniMagick
class << self
Expand Down Expand Up @@ -36,6 +37,16 @@ def from_blob(blob, ext = nil)
image
end

def from_uri( uri, ext = nil )
image = nil
begin
image = self.from_blob( uri.read, ext )
rescue Exception => e
raise e
end
image
end

# Use this if you don't want to overwrite the image file
def open(image_path)
File.open(image_path, "rb") do |f|
Expand Down

0 comments on commit 166bd8e

Please sign in to comment.