Current time: 07-21-2017, 03:44 AM Hello There, Guest! (LoginRegister)

Post Reply 
Rmagick dead on resize process
10-22-2007, 05:48 PM
Post: #1
Rmagick dead on resize process
Hi, this is my first post Smile.

Problem: I can't resize any image with Rmagick in rails application.

I soppose:
1 - Rmagick eats a lot of memory
and 2 - FCGI (or DH policies) kill the process to protect the others users of the shared server.

I do:
- make an RoR application to upload images. A simple model with post and many images.
- create a new domain user and assign this application.
- freeze gems
- change .htaccess[1] and fcgi distpacher[2]
- deploy an aplication with svn and capistrano.

My Report:
- The application works fine, fast, except the image uploading, it crash!

- Drop out Rmagick and install other gem for image manipulation. ImageScience for example. But Rmagick is the most complete tool.
- Extend my account to with >200MB of RAM.
- Find other job where they do not have technology involved such as goats keeper Smile [joke]

Someone could successfully implement an application to upload images?

Thanks in advance!!,


AddHandler fastcgi-script .fcgi
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

[2] -> from
NOTE: If not added this script or similar, most of the applications don't work or run veeeeery slow.


require File.dirname(__FILE__) + “/../config/environment“
require ‘fcgi_handler‘

class RailsFCGIHandler
def busy_exit_handler(signal)
dispatcher_log :info, “busy: asked to terminate during request signal #{signal}, deferring!“
@when_ready = :exit

# Dreamhost sends the term signal and if we’re handling a request defer it
def term_process_request(cgi)
rescue Exception => e # errors from CGI dispatch
raise if SignalException === e
install_signal_handler(’TERM‘, method(:exit_now_handler).to_proc)
alias_method :process_request, :term_process_request


Dario E. Brozzi
Find all posts by this user
Quote this message in a reply
11-12-2007, 08:47 PM
Post: #2
Rmagick dead on resize process
The problem is in File_column, in Gravity variable for crop functionality.

"Open up /vendor/plugins/file_column/lib/magick_file_column.rb, and remove the 'true' parameter to the img.crop function call on line 90"

Extracted from original solution by bentlegen's comment[1]

[1]File_column Plugin Broken :

Dario E. Brozzi
Find all posts by this user
Quote this message in a reply
Post Reply 

Forum Jump: