imogen 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72d6fdb5d3ff30a5b88603de22b081704f0cd525
4
- data.tar.gz: f4bbe60079ba2216d8e7f58f50a355e3a553f45c
3
+ metadata.gz: 1910c699380fcfbe8d180baf1c7ef25bbf521eba
4
+ data.tar.gz: 0ff96a7186b1265d68cfe02fded732efe37daa14
5
5
  SHA512:
6
- metadata.gz: 19e7f16d7f1e6cc363baf6000988c81de25429420fdd7d8282f8796a9d6e99304796ad50835ad7d63fcfad012c6bce3ac47f502db535da32e7b63bdab2b1939d
7
- data.tar.gz: f3c05ae821d2a6ab630c3bfe5753473a5c3070949bc0c1bf202f75aa368111642b84e87c0c5e7ad05d28c4c04d274d18bbe37e4ac0900535ea8aa7b9a0b25693
6
+ metadata.gz: 89d7cccae25fe76829cee9e1a73877fe8637963723ec6c4b48659956bfb61b655e383daefa23e1b2e930ee88e60af80adf52068d6d281e2e845ccf31d0dbcc10
7
+ data.tar.gz: be16bfdbd8fe83c64c0a6dabfc759e1af3a986aed72428f50cf62bb8c622a06b69db1bcbd49857fea375228f616b5d7d6e8f019083ac515ac1dcda3f7f2284eb
@@ -10,7 +10,7 @@ module Imogen
10
10
  @width = src.width
11
11
  @height = src.height
12
12
  else
13
- raise "#{src.class.name} does not report width and height"
13
+ raise "#{src.class.name} does not report width and height"
14
14
  end
15
15
  end
16
16
  def max(x,y)
@@ -43,8 +43,8 @@ module Imogen
43
43
  autoload :Rotation, 'imogen/iiif/rotation'
44
44
  autoload :Tiles, 'imogen/iiif/tiles'
45
45
 
46
- FORMATS = {jpeg: 'jpg', jpg: 'jpg', png: 'png'}
47
- EXTENSIONS = {'jpg' => :jpeg, 'png' => :png}
46
+ FORMATS = {jpeg: 'jpg', jpg: 'jpg', png: 'png', jp2: 'jp2'}
47
+ EXTENSIONS = {'jpg' => :jpeg, 'png' => :png, 'jp2' => :jp2}
48
48
  def self.convert(img, dest_path, format=nil, opts={})
49
49
  format ||= opts.fetch(:format,:jpeg)
50
50
  format = format.to_sym
@@ -56,9 +56,9 @@ module Imogen
56
56
  dst = FreeImage::File.new(dest_path)
57
57
  format = :jpeg if format == :jpg
58
58
  if (img.color_type == :rgb)
59
- quality.convert_to_24bits {|result| dst.save(result, format)}
59
+ quality.convert_to_24bits {|result| dst.save(result, format, (format == :jp2 ? 8 : 0))}
60
60
  else
61
- quality.convert_to_8bits {|result| dst.save(result, format)}
61
+ quality.convert_to_8bits {|result| dst.save(result, format, (format == :jp2 ? 8 : 0))}
62
62
  end
63
63
  end
64
64
  end
@@ -13,7 +13,7 @@ module Imogen
13
13
  end
14
14
  def self.convert(img, dest_path)
15
15
  dst = FreeImage::File.new(dest_path)
16
- dst.save(img, :jp2, 8)
16
+ dst.save(img, :jp2, 8)
17
17
  end
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imogen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Armintor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-24 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-opencv
@@ -80,8 +80,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.2.2
83
+ rubygems_version: 2.4.3
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: derivative generation via FreeImage and smart square thumbnail via OpenCV
87
87
  test_files: []
88
+ has_rdoc: