Image libraries for Ruby?

  • Thread starter forgottenwizard
  • Start date
F

forgottenwizard

I'm trying to write out a script to help me sort out a bunch (more than
1,000) wallpapers, and do so by wallpaper size. I've done a little
looking, but so far the only lib I have seen that might help is
ImageMagick, and I want to see if anyone knows of another to do this.

How I'm trying to do this:


gather the x and y size of the wallpaper (this is the hard part from
what I can see).

move that wallpaper into a directory with those dimensions as the name
(such as 1280x1024)

echo the name of that wallpaper, based on a set of rules, into a file to
use as a sort of database to help keep up with everything.
 
P

Philip Hallstrom

I'm trying to write out a script to help me sort out a bunch (more than
1,000) wallpapers, and do so by wallpaper size. I've done a little
looking, but so far the only lib I have seen that might help is
ImageMagick, and I want to see if anyone knows of another to do this.

How I'm trying to do this:


gather the x and y size of the wallpaper (this is the hard part from
what I can see).

move that wallpaper into a directory with those dimensions as the name
(such as 1280x1024)

echo the name of that wallpaper, based on a set of rules, into a file to
use as a sort of database to help keep up with everything.

http://pastie.caboo.se/98119

If they are all JPEG's that will work. If not, google around and you'll
find the routines for figuring it out for other image types. Or look at
PHP's getimagesize method's source which handles GIF, JPG, and PNG. All
it does is read some bits from the beginning of the file to get the right
one.

-philip
 
J

Just Another Victim of the Ambient Morality

forgottenwizard said:
I'm trying to write out a script to help me sort out a bunch (more than
1,000) wallpapers, and do so by wallpaper size. I've done a little
looking, but so far the only lib I have seen that might help is
ImageMagick, and I want to see if anyone knows of another to do this.

What's wrong with ImageMagick? It'll do what you need...
 
J

Julian Tarkhanov

What's wrong with ImageMagick? It'll do what you need...

Depends on what system you are running, might be problematic if it's
Win32 but if you are in the Mac or
if you already have ImageMagick (with convert and stuff, not the
devel libs) you can try my ImageProc. It's basically
one-sop API for bounds-resizing, in one file.

http://julik.textdriven.com/svn/tools/ruby_libs/image_proc/image_proc.rb

I do like the idea of scanning the headers PHP style, might have a go
at it once for ImageProc :)
 
F

forgottenwizard

Depends on what system you are running, might be problematic if it's Win32
but if you are in the Mac or
if you already have ImageMagick (with convert and stuff, not the devel
libs) you can try my ImageProc. It's basically
one-sop API for bounds-resizing, in one file.

http://julik.textdriven.com/svn/tools/ruby_libs/image_proc/image_proc.rb

I do like the idea of scanning the headers PHP style, might have a go at it
once for ImageProc :)

I didn't want to use ImageMagick because it did a bit more than I wanted
it to, but I went ahead an installed it.

I may look into your lib some, but that may come later when I know that
what I'm trying to do works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,269
Messages
2,571,346
Members
48,021
Latest member
anchal126

Latest Threads

Top