Title: [926] trunk/image_voodoo/lib: Get all image science tests working
- Revision
- 926
- Author
- nicksieger
- Date
- 2008-03-04 17:04:50 -0500 (Tue, 04 Mar 2008)
Log Message
Get all image science tests working
Modified Paths
Diff
Modified: trunk/image_voodoo/lib/image_science.rb (925 => 926)
--- trunk/image_voodoo/lib/image_science.rb 2008-03-04 21:48:31 UTC (rev 925)
+++ trunk/image_voodoo/lib/image_science.rb 2008-03-04 22:04:50 UTC (rev 926)
@@ -1,2 +1,3 @@
require 'image_voodoo'
+# HA HA...let the pin-pricking begin
ImageScience = ImageVoodoo
\ No newline at end of file
Modified: trunk/image_voodoo/lib/image_voodoo.rb (925 => 926)
--- trunk/image_voodoo/lib/image_voodoo.rb 2008-03-04 21:48:31 UTC (rev 925)
+++ trunk/image_voodoo/lib/image_voodoo.rb 2008-03-04 22:04:50 UTC (rev 926)
@@ -95,10 +95,12 @@
end
def self.with_image(file)
+ readers = ImageIO.getImageReadersBySuffix(File.extname(file)[1..-1])
+ raise TypeError, "unrecognized format for #{file}" unless readers.hasNext
image = ImageIO.read(JFile.new(file))
yield ImageVoodoo.new(image)
rescue NativeException => ne
- raise TypeError, ne.message
+ nil
end
def self.with_bytes(bytes)
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel