pano 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/bin/pntool +3 -2
  2. data/lib/pano/image_file_set.rb +11 -9
  3. metadata +21 -8
data/bin/pntool CHANGED
@@ -1,6 +1,7 @@
1
- #!ruby
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  require 'pano'
4
+ require 'fileutils'
4
5
 
5
6
  set = Pano::ImageFileSet.new FileUtils.pwd
6
- set.spit_and_copy_files
7
+ set.spit_and_copy_files ARGV.include?("apply_mask")
@@ -44,7 +44,7 @@ module Pano
44
44
  [panos, misc]
45
45
  end
46
46
 
47
- def spit_and_copy_files
47
+ def spit_and_copy_files apply_mask = false
48
48
  puts "analysing files..."
49
49
  panos, misc = split_images
50
50
  panos.each_with_index do |pano, index|
@@ -57,14 +57,16 @@ module Pano
57
57
  pano.each_slice(3) do |files|
58
58
  i+=1
59
59
  fused = enfuse(File.join(pano_dir, "fused"), "%02d" % i, files)
60
- if (1..6).include? i
61
- system "convert #{fused} #{TOOL_ROOT}/lib/mask.png \
62
- +matte -compose CopyOpacity -composite \
63
- #{fused}"
64
- elsif i >= pano.length
65
- system "convert #{fused} #{TOOL_ROOT}/lib/mask_last.png \
66
- +matte -compose CopyOpacity -composite \
67
- #{fused}"
60
+ if apply_mask
61
+ if (1..6).include? i
62
+ system "convert #{fused} #{TOOL_ROOT}/lib/mask.png \
63
+ +matte -compose CopyOpacity -composite \
64
+ #{fused}"
65
+ elsif i >= pano.length
66
+ system "convert #{fused} #{TOOL_ROOT}/lib/mask_last.png \
67
+ +matte -compose CopyOpacity -composite \
68
+ #{fused}"
69
+ end
68
70
  end
69
71
  system "mogrift -rotate -90 #{fused}"
70
72
  system "exiftool -overwrite_original -TagsFromFile #{files.first.jpg_path} #{fused}"
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 6
9
+ version: 0.0.6
5
10
  platform: ruby
6
11
  authors:
7
12
  - Yury Korolev
@@ -14,14 +19,18 @@ default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: activesupport
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 3
30
+ - 5
23
31
  version: 2.3.5
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  description: Split and fuse images for pano
26
35
  email:
27
36
  - yury.korolev@gmail.com
@@ -52,18 +61,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
61
  requirements:
53
62
  - - ">="
54
63
  - !ruby/object:Gem::Version
64
+ segments:
65
+ - 0
55
66
  version: "0"
56
- version:
57
67
  required_rubygems_version: !ruby/object:Gem::Requirement
58
68
  requirements:
59
69
  - - ">="
60
70
  - !ruby/object:Gem::Version
71
+ segments:
72
+ - 1
73
+ - 3
74
+ - 5
61
75
  version: 1.3.5
62
- version:
63
76
  requirements: []
64
77
 
65
78
  rubyforge_project:
66
- rubygems_version: 1.3.5
79
+ rubygems_version: 1.3.6
67
80
  signing_key:
68
81
  specification_version: 3
69
82
  summary: "\"Just prepare photos for pano\""