FreeImage on my Slice

July 27, 2007 @ 01:21 AM | posted by carmelyne

(last updated: 08.03.07)

FreeImage woes are better than RMagick woes.



First I tried installing FreeImage using this article:
http://seattlerb.rubyforge.org/ImageScience.html

Unfortunately, I get an error with make:

1
2
3
4
Source/Metadata/Exif.cpp:498: error: cast from 'BYTE*' to 'DWORD' loses precision
make[1]: *** [Source/Metadata/Exif.o] Error 1
make[1]: Leaving directory `/usr/local/src/FreeImage'
make: *** [default] Error 2

And If I proceeded with sudo make install, another error:

1
2
3
4
5
6
7
8
make -f Makefile.gnu install 
make[1]: Entering directory `/usr/local/src/FreeImage'
install -m 644 -o root -g root Source/FreeImage.h /usr/include
install -m 644 -o root -g root libfreeimage.a /usr/lib
install: cannot stat `libfreeimage.a': No such file or directory
make[1]: *** [install] Error 1
make[1]: Leaving directory `/usr/local/src/FreeImage'
make: *** [install] Error 2

After Googling awhile I found another repo for FreeImage.

So Let's try this again:

1
2
3
4
5
6
cd /usr/local/src
sudo wget http://ftp.cica.es/ubuntu/ubuntu/pool/universe/f/freeimage/freeimage_3.9.3.orig.tar.gz
sudo tar -xvf freeimage_3.9.3.orig.tar.gz
cd freeimage-3.9.3.repacked/FreeImage
make
sudo make install

Then I did:

1
2
gem install -y rubyinline
gem install -y image_science

Now off to my attachment_fu and crossing my fingers that it works.... Yup it works.

I'm not sure if freeimage_3.9.3.orig.tar.gz is the latest version but I'm happy enough that it works with attachment_fu.

I really have no idea why I got the errors above but one thing is for sure: It didn't work for me!

[ Last updated: August 03, 2007 @ 11:06 AM ]


6 Responses to...
“FreeImage on my Slice”

  1. BrianC:

    Hey, thanks a lot for posting this. I just ran into it while setting up a new machine.

    One edit you might want to make is on line 6 it has

    sudo make

    which probably wants to be sudo make install.

    I'm sure 99.75% of the ppl reading this will know that, but they'll also want to cut and paste :P

    Thanks again.



    Posted:
  2. carmelyne:

    I'm glad it helped. I also fixed line 6 to read sudo make install :) Thanks.



    Posted:
  3. siannopollo:

    I've been bashing my head against this problem for the last half hour. Thank you so much!



    Posted:
  4. carmelyne:

    Glad it helped.



    Posted:
  5. Ryan Davis:

    OUCH. Sorry about the problems. I wish you'd had filed a bug so I could have helped. Matt Mower and I just worked out some changes to help and I added them to my instructions at: http://seattlerb.rubyforge.org/ImageScience.html (with props to this page)



    Posted:
  6. Carmelyne:

    Hi Ryan, that's great. I wasn't sure if it was an actual bug or just me doing some goofy thing. Thanks for the fix. :)



    Posted:

Sorry, comments are closed for this article.

Snippets of 06/24/07

Rails 'A'..'Z' Paginate

1
2
3
4
5
6
7
8
9
10
11
# Starts with 'A'..'Z' Paginate / model
def self.sort(sort)
  if sort
    find(:all, :conditions => ['name LIKE ?', "#{sort}%"])
  else
    find(:all, :order => 'name')
  end  
end

# index action / controller
@models = Model.sort(params[:sort]) 

Recent Posts...

RailsConf 2006
I heart devChix