Displaying 4 results from an estimated 4 matches for "crop_resized".
2007 Jan 04
1
rmagick working in console but not in my app
hey all,
When I do this in script/console I get:
>> require ''RMagick''
=> true
>> include Magick
=> Object
>> f = Image.new(100,100) { self.background_color = "red" }
=> 100x100 DirectClass 16-bit
>> f.crop_resized(50,50)
=> 50x50 DirectClass 16-bit
But in my application I keep getting the same error as if rmagick was
not installed though it is and I can use it with irb. This is the
error I get:
ActionView::TemplateError (undefined method `crop_resized'' for
nil:NilClass) on line #7 of app/view...
2006 Mar 08
3
file_column Cropping -> image offset information
Hello,
I had a problem cropping images with file_column. These are my settings:
file_column :image, :magick => {
:versions => {
:thumb => "80x80>",
:medium => "150x150>",
:square => {
:crop => "1:1",
:size => "50x50!"
}
},
2006 Jul 26
0
webrick slows and crashes on thumbnail creation
ok here is my view code:
<% for img in ary %>
<%= resize_image img.name %> # img.name= /homa/joe/pictureimg.jpg
<% end %>
here is my resize_image code in application_helper:
def resize_image(imgfile)
pic = Magick::Image.read(imgfile).first
thumb = pic.crop_resized(maxwidth, maxheight,
gravity=Magick::CenterGravity)
thumb.write(imgfile+''thumb'')
end
What happens:
When "ary" contains 50 images to resize, it goes fast on the first 4 images
then the whole thing slows down and and the ruby proccess occupies like 50%
of CPU and 70%...
2008 Sep 23
3
calling save in after_create hook
Scenario:
I''m creating an image file upload service for my web site.
As well as saving the actual file I also need to create a database
record for the file.
I would like to name the file after the record id, but I also need to
save some attributes of the image (width/height/mime_type etc) which I
can''t discover until after the file is created.
The Problem:
1) The id is not