main_app/app/models/link.rb
#MAKE A PREVIEW DIRECTORY AND FULL DIRECTORY
MAKE A PREVIEW DIRECTORY AND FULL DIRECTORY
MAKE A PREVIEW DIRECTORY AND FULL DIRECTORY
def make_preview_image(file,type)
    case type
    when :text
      Docsplit.extract_images(file, :size => '400x', :format => [:png], :pages => 1, :output => PREVIEW_DIR)
      name = File.basename(upload_path, '.*') + "_1" +".png"
      self.update_attribute(:preview_file_path, name)
    when  :image
      name = MagickThumbs.make_thumbs(:file_url => file, :file_name => self.upload_path, :size => "200x200")
      self.update_attribute(:preview_file_path, name)
    else
      nil 
    end
  end
def make_preview_image ( file , type ) case type when :text Docsplit . extract_images ( file , :size => '400x' , :format => [ :png ] , :pages => 1 , :output => PREVIEW_DIR ) name = File . basename ( upload_path , '.*' ) + "_1" + ".png" self . update_attribute ( :preview_file_path , name ) when :image name = MagickThumbs . make_thumbs ( :file_url => file , :file_name => self . upload_path , :size => "200x200" ) self . update_attribute ( :preview_file_path , name ) else nil end end
MAKE A PREVIEW DIRECTORY AND FULL DIRECTORY
MAKE A PREVIEW DIRECTORY AND FULL DIRECTORY
#the _1 is a peculiarity of Docsplit when selecting individual pages
file
<not_specific>
type
<not_specific>