wraith 1.3.2 → 1.3.3

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: 49d53e6583e9fabf57c3f55f25567c2ac8ce32ec
4
- data.tar.gz: 88d3d71b9c69d819769a5ab18d92a5433d1c2900
3
+ metadata.gz: 36d791b93337c426ab9bc7d78b4c2993f169ced8
4
+ data.tar.gz: 4bf74d7e73e55bf6822021dbe85e6ad0b461cd16
5
5
  SHA512:
6
- metadata.gz: f676037d79b75fb02c4912bc23a4ab119fd5a0ab7645bade4ecc4abb3672c0c08cda53a53942989d8f31eb71edd8c0cb1780e6435e1b64e14fac2c6b6ed68465
7
- data.tar.gz: 7610535f0bfe23ff74df774502e32f8f63ec30423a3e42e1b1f071deb31c387b9d51249e1ef7f60895cc71f896aafd528afa908502ab33ba178ea4c9fba68ed7
6
+ metadata.gz: 65aec8546903c5456ef18c3b9b6bc4097aa908b35a2e067a26188fd9055fa39d848a12c40d6e9446d9b09c1b41a209e85a328eec60c961051d0aef37f2783585
7
+ data.tar.gz: bdd4aa15de02acc699e749e1e6fb4ae4dff36c4d3ac7634cc8bc66eb666953c6c1f7d414a833069baa22c351d17b706628ebb9fd27455121bd008c87e0bc7611
data/lib/wraith/crop.rb CHANGED
@@ -15,8 +15,9 @@ class Wraith::CropImages
15
15
  Parallel.each(files.each_slice(2), in_processes: Parallel.processor_count) do |base, compare|
16
16
  puts 'cropping images'
17
17
 
18
- base_height = image_height(base)
19
- compare_height = image_height(compare)
18
+ width = image_dimensions(base)[0]
19
+ base_height = image_dimensions(base)[1]
20
+ compare_height = image_dimensions(compare)[1]
20
21
 
21
22
  if base_height > compare_height
22
23
  image_to_crop = compare
@@ -26,18 +27,15 @@ class Wraith::CropImages
26
27
  height_to_crop_to = compare_height
27
28
  end
28
29
 
29
- crop_task(image_to_crop, height_to_crop_to)
30
+ crop_task(image_to_crop, height_to_crop_to, width)
30
31
  end
31
32
  end
32
33
 
33
- def crop_task(crop, height)
34
- `convert #{crop} -background none -extent 0x#{height} #{crop}`
34
+ def crop_task(crop, height, width)
35
+ `convert #{crop} -background none -extent #{width}x#{height} #{crop}`
35
36
  end
36
37
 
37
- def image_height(image)
38
- File.open(image, 'rb') do |fh|
39
- size = ImageSize.new(fh.read).size
40
- size[1]
41
- end
38
+ def image_dimensions(image)
39
+ ImageSize.new(File.open(image, 'rb').read).size
42
40
  end
43
41
  end
@@ -1,3 +1,3 @@
1
1
  module Wraith
2
- VERSION = '1.3.2'
2
+ VERSION = '1.3.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wraith
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Blooman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-04 00:00:00.000000000 Z
12
+ date: 2014-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry