search for: create_thumbnail

Displaying 5 results from an estimated 5 matches for "create_thumbnail".

2006 Jul 17
6
3 newbie questions
...SELECT * FROM pictures WHERE (pictures.album_id = 1) so it looks like the :foreign_key => "dirid" is ignored. Any idea what I could make it work? Third question: I would like to right some code that would work like this: <% if thumbnail-file.jpg doesn''t exists execute create_thumbnail() file.jpg %> I already have the create_thumbnail() working. Any idea how to write this right? thanx in advance Pat
2006 Mar 06
4
Newbie problem with adding new method to a class
Hi! If i have Image class and i''d like to add ''create_thumbnail'' method to it, which will later be called from product controller, where to put this method and how to call it? I''ve tried putting it inside image controller and image model, then call it like Image.create_thumbnail, but it didn''t work - undefined method `create_thum...
2006 Jul 25
1
How do I validate using associated objects?
...s from the Comment model. This is frustrating the hell out of me :( class Comment < ActiveRecord::Base belongs_to :board has_many :uploads end class Upload < ActiveRecord::Base belongs_to :comment end class Image < Upload before_create :create_image before_create :create_thumbnail def create_image @image = Magick::ImageList.new.from_blob(@upload_blob) self[:image_width] = @image.columns self[:image_height] = @image.rows end def create_thumbnail @thumbnail = Magick::ImageList.new.from_blob(@image[0].to_blob) if comment.parent_id == nil...
2006 Apr 24
0
ImageMagick and EXIF Data
...join(THUMBDIRECTORY, "#{self.id}-thumb.jpg") end def self.display_all_images find(:all, :order => "created_at desc") end private ####### def process if @file_data create_directory cleanup save_fullsize create_fullsize create_thumbnail load_exif_data @file_data = nil end end def save_fullsize File.open(path,''w'') do |file| file.puts @file_data.read end end def create_fullsize img = Magick::Image.read(path).first img.change_geometry!(''700 x 700'') {...
2010 Oct 01
20
Paperclip not executing FFMPEG properly
Im using a customs processor to run ffmpeg on a video to create a thumbnail. So far so good. Except when I do: cmd = "-i #{@file.path} -f flv -s 320x240 ~/Downloads/foobar/q.flv" success = Paperclip.run(''ffmpeg'', cmd) Console is reporting: ffmpeg ''-i /var/folders/uL/uL0bYOOZEZaJH5E+BmDJVE+++TI/-Tmp-/stream, 16824,1.mpeg -f flv -s 320x240