Title: [889] trunk/image_voodoo/lib/image_voodoo.rb: Use a normal byte-packed binary BufferedImage so it works headless.
Revision
889
Author
headius
Date
2008-02-07 00:00:46 -0500 (Thu, 07 Feb 2008)

Log Message

Use a normal byte-packed binary BufferedImage so it works headless.

Modified Paths


Diff

Modified: trunk/image_voodoo/lib/image_voodoo.rb (888 => 889)


--- trunk/image_voodoo/lib/image_voodoo.rb	2008-02-07 03:54:49 UTC (rev 888)
+++ trunk/image_voodoo/lib/image_voodoo.rb	2008-02-07 05:00:46 UTC (rev 889)
@@ -28,10 +28,7 @@
   end
 
   def resize(width, height)
-    ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment
-    gc = ge.getDefaultScreenDevice.getDefaultConfiguration
-    transparency = @src.color_model.transparency
-    target = gc.create_compatible_image width, height, transparency
+    target = BufferedImage.new(width, height, BufferedImage::TYPE_BYTE_BINARY)
     graphics = target.graphics
     graphics.set_rendering_hint RenderingHints::KEY_INTERPOLATION, RenderingHints::VALUE_INTERPOLATION_BICUBIC
     transform = AffineTransform.get_scale_instance width.to_f/@src.width, height.to_f/@src.height
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to