selfiegram 0.0.9 → 0.0.10

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: 2f6b1e00ff9195e8afdf29f70c647009d730bd6d
4
- data.tar.gz: ec033ea8ef820575809bdc89d4d4b77c01ccab33
3
+ metadata.gz: fa1d87a6e7d2d54b04c371b627492d6e5bd31e2b
4
+ data.tar.gz: 6d73b3c24160401b5e693e11a8769a8b1e708c42
5
5
  SHA512:
6
- metadata.gz: 06956b1e0c797553f37655787fe8f8a612a5eed646f9ed136e1a997f0711dbf9b597cd4c46a06caaa967b47fe23b978f57b979a934b110698ecfee8a35a1c6ee
7
- data.tar.gz: fe8133092323d4042d365095f051c7cacd147f4b27110c38f12ce2b7fbae33f63957f1555d1ed9f78cf9fb6b4b2268d3b6039432fe4a67f604c2e7a10c7f6e08
6
+ metadata.gz: a074763cfa329e5e50330f8de4d8f73e0c125040763aba7c6d957655b15532a4258b402fe26f3bf0f5ed4187983c90cdd614b3f777d31c5fbd88fc5ec1ffb791
7
+ data.tar.gz: 059312e8c2d02d251115b46678cfdd37ac2d1b67af1e70198909956ea98d7371c96f47d94590027e348182cadd1a5fc9c36162d4f4485719ad9dbfb2add58c54
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.0.10
@@ -17,10 +17,15 @@ module BackgroundImages
17
17
 
18
18
  `convert #{local_file}.#{file_extension} -resize '#{dimensions}^' -gravity 'center' -crop '#{dimensions}+0+0' #{local_file}.#{destination_extension}`
19
19
 
20
- if command_failed?
20
+ begin
21
+ image = Magick::Image.read("#{local_file}.#{destination_extension}")
22
+ rescue
23
+ end
24
+
25
+ if command_failed? || image.nil?
21
26
  get_new_background_image
22
27
  download
23
- standardize
28
+ standardize(selfie_image)
24
29
  end
25
30
 
26
31
  self
@@ -44,7 +49,7 @@ module BackgroundImages
44
49
  end
45
50
 
46
51
  def acceptable_extensions
47
- ["png"]
52
+ ["jpg", "png"]
48
53
  end
49
54
 
50
55
  def acceptable_extension?(extension)
@@ -52,7 +57,7 @@ module BackgroundImages
52
57
  end
53
58
 
54
59
  def file_extension(file=download_url)
55
- "png"
60
+ file.split(".").last
56
61
  end
57
62
 
58
63
  def download_url
@@ -90,4 +90,3 @@ private
90
90
  FileUtils.mkdir_p(dir)
91
91
  end
92
92
  end
93
-
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: selfiegram 0.0.9 ruby lib
5
+ # stub: selfiegram 0.0.10 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "selfiegram"
9
- s.version = "0.0.9"
9
+ s.version = "0.0.10"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selfiegram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Shollenberger