desoto-photoapp 0.3.13 → 0.4.0

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: 12843f84063ab4c237cd748175c29c503f696178
4
- data.tar.gz: 9edfcc231a6fbbad2c2c00602149c8a2afa8f4d3
3
+ metadata.gz: 41ab1f398a0bbeffd3c2a3cd706d06af5af61b13
4
+ data.tar.gz: 6c4d936736f34c912d22e17d6e07c99e53123aaa
5
5
  SHA512:
6
- metadata.gz: 984bc63ef359b19cae05f2c854d25f11243b2bcdbcc5f29d8ea819c9b3e5ed7b00ff7c99bac34bc82429951a4720fda5690bb315e592bd55b69bbae17c205c27
7
- data.tar.gz: 536f2c8b809a7cef670699596fb2c36379e79908584b83ec954cfe8dc306ea622df11a3e2e034e4d1b027b745a93a94fd3f2a3b95f650b4fdf87dbee58e6ab34
6
+ metadata.gz: 38d54f93d076252d54a43d808257769a38c7c0271724f86a30920d60ea153801195cec2e68e2efcbefd80ca934dca45c987320cdb1e81ff593c51531a9d36b0d
7
+ data.tar.gz: 5c5077022600b123ead6725c3074c7c4210870caaefab218926cbf7ae80c99da62a847dec7d9ba2ed066cebe13c49f7d2e643f2543c61fb1811d746d7a29c3c5
data/README.md CHANGED
@@ -10,6 +10,14 @@ Add this line to your application's Gemfile:
10
10
  gem 'desoto-photoapp'
11
11
  ```
12
12
 
13
+ Install ImageMagick
14
+
15
+ ```
16
+ brew remove imagemagick
17
+ brew update && brew install imagemagick@6"
18
+ brew link imagemagick@6
19
+ ```
20
+
13
21
  And then execute:
14
22
 
15
23
  $ bundle
@@ -17,7 +25,8 @@ And then execute:
17
25
  Install the [Automator actions](https://photosautomation.com/index.html) for importing photos. Download the [installer here](https://photosautomation.com/installer.zip).
18
26
 
19
27
 
20
- Run the setup command:
28
+
29
+ Run the setup commands:
21
30
 
22
31
  ```
23
32
  $ photoapp setup
Binary file
data/assets/watermark.png CHANGED
Binary file
data/exe/photoapp CHANGED
@@ -30,14 +30,11 @@ end
30
30
 
31
31
  def actions
32
32
  system "open /System/Library/Image\\ Capture/Support/Application/AutoImporter.app"
33
- system "open /System/Library/CoreServices/Folder\\ Actions\\ Setup.app"
33
+
34
+ system 'open '+folder_actions_setup
34
35
  end
35
36
 
36
37
  def setup
37
- if `brew list imagemagick` =~ /Error:/
38
- system "brew update && brew install imagemagick"
39
- end
40
-
41
38
  unless `ls /Library/Automator` =~ /Import Files into Photos/
42
39
  system "say 'please install Automator actions for Photos app'"
43
40
  system "open #{Photoapp.gem_dir('assets/photos-action-installer.pkg')}"
@@ -47,6 +44,25 @@ def setup
47
44
  actions
48
45
  end
49
46
 
47
+ def folder_actions_setup
48
+
49
+ @app_path ||= begin
50
+ app = 'Folder Actions Setup.app'
51
+ base = '/System/Library/CoreServices/'
52
+
53
+ old = File.join( base, app )
54
+ new = File.join( base, 'Applications', app )
55
+
56
+ path = if File.exist? old
57
+ old
58
+ elsif File.exist? new
59
+ new
60
+ end
61
+
62
+ path.gsub(' ', '\ ')
63
+ end
64
+ end
65
+
50
66
  if options['version']
51
67
  puts Photoapp::VERSION
52
68
  abort
@@ -58,19 +74,19 @@ case cmd
58
74
  when 'config'
59
75
  case ARGV.shift
60
76
  when 'printer'
77
+ system 'open https://github.com/imathis/desoto-photoapp#default-printer-settings'
78
+ system 'say "Configure your printer according to these configurations"'
79
+ sleep 3
61
80
  system 'open http://127.0.0.1:631/printers/'
62
81
  system 'say "Choose the printer you want to configure"'
63
82
  sleep 3
64
83
  system 'say "Select Set Default Options from the Administration drop-down."'
65
- sleep 3
66
- system 'say "then configure your printer based on the settings you see here"'
67
- sleep 3
68
- system 'open https://github.com/imathis/desoto-photoapp#default-printer-settings'
84
+ system 'say "Then refer to the printer configurations listed ealier."'
69
85
  when 'import'
70
86
  system 'say "launching AutoImporter, press command comma to change settings"'
71
87
  system 'open /System/Library/Image\ Capture/Support/Application/AutoImporter.app'
72
88
  when 'action'
73
- system 'open /System/Library/CoreServices/Folder\ Actions\ Setup.app'
89
+ system 'open '+folder_actions_setup
74
90
  system 'say "Add an action for the cave.pics/import folder and select the photoapp process workflow from the list. Then close the app."'
75
91
  end
76
92
  when 'test'
data/lib/photoapp.rb CHANGED
@@ -41,10 +41,11 @@ module Photoapp
41
41
 
42
42
  config = {
43
43
  'source' => Dir.pwd, # where photos are located
44
- 'url_base' => 'www.cave.pics',
44
+ 'url_base' => 'cave.pics',
45
45
  'watermark' => Photoapp.gem_dir('assets', 'watermark.png'),
46
46
  'font' => Photoapp.gem_dir('assets', "SourceSansPro-Semibold.ttf"),
47
- 'font_size' => 30,
47
+ 'font_size' => 36,
48
+ 'date_font_size' => 24,
48
49
  'config' => 'photoapp.yml',
49
50
  'upload' => 'upload',
50
51
  'print' => 'print',
@@ -21,33 +21,59 @@ module Photoapp
21
21
  end
22
22
 
23
23
  def watermark
24
- @watermarked ||= image.composite(logo, SouthWestGravity, 80, 40, OverCompositeOp)
24
+ @watermarked ||= begin
25
+ date = date_text
26
+ image.composite(logo, SouthWestGravity, 50, 40, OverCompositeOp)
27
+ .composite(date[0], SouthWestGravity, 5, -10, OverCompositeOp)
28
+ .composite(date[1], SouthWestGravity, 5, -10, OverCompositeOp)
29
+ end
25
30
  end
26
31
 
27
32
  def with_url
28
33
  @printable ||= begin
29
- light_url = add_url("#fff")
30
- dark_url = add_url("#000", true).blur_image(radius=6.0, sigma=2.0)
34
+ url = url_text
31
35
  watermark.dup
32
- .composite(dark_url, SouthEastGravity, 80, 40, OverCompositeOp)
33
- .composite(light_url, SouthEastGravity, 80, 40, OverCompositeOp)
36
+ .composite(url[0], SouthEastGravity, 40, 30, OverCompositeOp)
37
+ .composite(url[1], SouthEastGravity, 40, 30, OverCompositeOp)
34
38
  end
35
39
  end
36
40
 
37
- def add_url(color, stroke=false)
41
+ def url_text
42
+ add_shadowed_text "#{config['url_base']}/#{short}.jpg", config['font_size'], NorthEastGravity
43
+ end
44
+
45
+ def date_text
46
+ date = Time.now.strftime('%b %d, %Y')
47
+ add_shadowed_text date, config['date_font_size'], NorthEastGravity, 250
48
+ end
49
+
50
+ def add_shadowed_text(text, size, gravity, width=800)
38
51
  setting = config
39
- image = Image.new(800,100) { self.background_color = "rgba(255, 255, 255, 0)" }
40
- text = Draw.new
41
- text.annotate(image, 0, 0, 60, 50, "#{setting['url_base']}/#{short}.jpg") do
42
- text.gravity = SouthEastGravity
43
- text.pointsize = setting['font_size']
44
- text.fill = color
45
- text.font = setting['font']
46
- if stroke
47
- text.stroke = color
52
+ shadowed_text = []
53
+
54
+ %w(#000 #fff).each do |color|
55
+ image = Image.new(width, 70) { self.background_color = "rgba(255, 255, 255, 0" }
56
+ txt = Draw.new
57
+ txt.annotate(image, 0, 0, 0, 0, text) do
58
+ txt.gravity = gravity
59
+ txt.pointsize = size
60
+ txt.fill = color
61
+ txt.font = setting['font']
62
+
63
+ if color == '#000'
64
+ txt.stroke = color
65
+ end
66
+ end
67
+
68
+ # Blur drop shadow
69
+ if color == '#000'
70
+ image = image.blur_image(radius=6.0, sigma=2.0)
48
71
  end
72
+
73
+ shadowed_text.push image
49
74
  end
50
- image
75
+
76
+ shadowed_text
51
77
  end
52
78
 
53
79
  def write(path=nil)
@@ -1,3 +1,3 @@
1
1
  module Photoapp
2
- VERSION = "0.3.13"
2
+ VERSION = "0.4.0"
3
3
  end
data/photoapp.gemspec CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_runtime_dependency "colorator"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.9"
25
- spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rake"
26
26
  spec.add_development_dependency "pry-byebug"
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: desoto-photoapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-21 00:00:00.000000000 Z
11
+ date: 2017-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry-byebug
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -186,6 +186,7 @@ files:
186
186
  - assets/Update.app/Contents/Resources/zh_CN.lproj/ApplicationStub.nib
187
187
  - assets/Update.app/Contents/Resources/zh_TW.lproj/ApplicationStub.nib
188
188
  - assets/Update.app/Contents/document.wflow
189
+ - assets/logo-source.afdesign
189
190
  - assets/photoapp-process.workflow/Contents/Info.plist
190
191
  - assets/photoapp-process.workflow/Contents/QuickLook/Thumbnail.png
191
192
  - assets/photoapp-process.workflow/Contents/document.wflow
@@ -225,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
226
  version: '0'
226
227
  requirements: []
227
228
  rubyforge_project:
228
- rubygems_version: 2.4.7
229
+ rubygems_version: 2.5.1
229
230
  signing_key:
230
231
  specification_version: 4
231
232
  summary: A tool for processing cave photos for DeSoto Caverns.