Thursday, January 15, 2009

Resizing animated gif on attachment_fu's Rmagick

So your animated GIF doesn't animate after going through attachment_fu's Rmagick resizing?

Go find the file lib/technoweenie/attachment_fu/processors/rmagick_processor.rb inside plugins/attachment_fu.

Then find this part:

def with_image(file, &block)
...
binary_data = file.is_a?(Magick::Image) ? file : Magick::Image.read(file).first unless !Object.const_defined?(:Magick)
...
end


and change Magick::Image.read(file) to Magick::ImageList.read(file). The result is:

def with_image(file, &block)
...
binary_data = file.is_a?(Magick::Image) ? file : Magick::ImageList.read(file).first unless !Object.const_defined?(:Magick)
...
end

Wednesday, January 14, 2009

Cooperation and punishment

Apparently we need to introduce an element of punishment to get people to cooperate, but this is only good in democratic societies.

In countries like the USA, Switzerland and the UK, freeloaders accepted their punishment and became much more co-operative. But in countries based on more authoritarian and parochial social institutions such as Oman, Saudi Arabia, Greece and Russia, the freeloaders took revenge — retaliating against those who had punished them. - http://www.physorg.com/news124046352.html

Friday, January 9, 2009

ddate

Go and type
ddate
on your Linux console and be surprised.