Creating on the fly jpgs/pngs etc

I want to create jpgs on the fly but I dont see any module for this. There
is a ruby/GD module but it has to be build from ruby source which Im
disinclined to do. Are there any other solutions anyone knows of?

···

Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
<><><><><><><> The Worlds Uncensored News Source <><><><><><><><>

Very lightweight jpgs or heavy-weight flies? :wink:

Seriously, I know of nothing like this for ruby but haven’t looked
hard either. Java has this but it was a real bear to use last time I
looked.

···

At 01:37 AM +0900 12/25/02, me wrote:

I want to create jpgs on the fly but I dont see any module for this. There
is a ruby/GD module but it has to be build from ruby source which Im
disinclined to do. Are there any other solutions anyone knows of?

Brad Cox, PhD; bcox@virtualschool.edu 703 361 4751 http://virtualschool.edu
o For industrial age goods there were checks and credit cards.
For everything else there is http://virtualschool.edu/mybank
o Java Web Application Architecture: http://virtualschool.edu/jwaa
o Ruby Interactive Learning Environment http://virtualschool.edu/ile
o Support Israel and Palestine: http://virtualschool.edu/mideast

I want to create jpgs on the fly but I dont see any module for this. There
is a ruby/GD module but it has to be build from ruby source which Im
disinclined to do. Are there any other solutions anyone knows of?

Very lightweight jpgs or heavy-weight flies? :wink:

Imlib2-Ruby can create jpgs on the fly.

pabs@vault:~/proj/jpg> cat ./jpg.rb
#!/usr/bin/ruby
require ‘imlib2’

im = Imlib2::Image.new 640, 480
im.fill_rect 0, 0, 640, 480, Imlib2::Color::RED

begin
im.save ‘output.jpg’
rescue
$stderr.puts “Couldn’t save output.jpg: #$!”
end

pabs@vault:~/proj/jpg> ./jpg.rb
pabs@vault:~/proj/jpg> file ./output.jpg
./output.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, 1 x 1
pabs@vault:~/proj/jpg>

Caveats: Only works under Unix variants (Linux, FreeBSD, etc), and
Imlib2 itself is not really being actively developed any more (although
there are bugfixes etc). Anyway, Imlib2-Ruby is available at
http://www.pablotron.org/software/imlib2-ruby/ if you want to check it
out (and there are packages available for Debian, as well as a FreeBSD
port). I’m looking at wrapping another popular image processing
library, but I haven’t started on that yet.

···
  • Brad Cox (bcox@virtualschool.edu) wrote:

At 01:37 AM +0900 12/25/02, me wrote:

Seriously, I know of nothing like this for ruby but haven’t looked
hard either. Java has this but it was a real bear to use last time I
looked.

Brad Cox, PhD; bcox@virtualschool.edu 703 361 4751 http://virtualschool.edu
o For industrial age goods there were checks and credit cards.
For everything else there is http://virtualschool.edu/mybank
o Java Web Application Architecture: http://virtualschool.edu/jwaa
o Ruby Interactive Learning Environment http://virtualschool.edu/ile
o Support Israel and Palestine: http://virtualschool.edu/mideast


Paul Duncan pabs@pablotron.org pabs in #gah (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562