Module: Asposeimagingjava::ExtractTiffFramesToOtherFormat

Defined in:
lib/asposeimagingjava/images/extracttiffframestootherformat.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/asposeimagingjava/images/extracttiffframestootherformat.rb', line 3

def initialize()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'

    # Load an existing image

    image = Rjb::import('com.aspose.imaging.Image').load(data_dir + "multipage.tiff")

    frames = image.getFrames()
    i = 1
    frames.each do |frame|
        frame.save(data_dir + "frame#{i}.jpg", Rjb::import('com.aspose.imaging.imageoptions.JpegOptions').new)
        i +=1
    end

    puts "Saved images successfully!"
end