3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/asposeimagingjava/images/addthumbnailtoexifsegment.rb', line 3
def initialize()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
thumbnail = Rjb::import('com.aspose.imaging.fileformats.jpeg.JpegImage').new(100, 100)
image = Rjb::import('com.aspose.imaging.fileformats.jpeg.JpegImage').new(1000, 1000)
image.setExifData(Rjb::import('com.aspose.imaging.exif.JpegExifData').new)
image.getExifData().set_Thumbnail(thumbnail)
image.save(data_dir + "Thumbnail_EXIF.jpg")
puts "Added thumbnail to EXIF segment successfully!"
end
|