moiristo-tileup 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +12 -10
- data/{LICENCE.txt → LICENSE.txt} +0 -0
- data/README.md +4 -1
- data/Rakefile +1 -0
- data/lib/tileup/image_processor.rb +1 -1
- data/lib/tileup/tiler.rb +7 -2
- data/lib/tileup/version.rb +1 -1
- data/tileup.gemspec +1 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7dd89cc58c1fe5d6687136a0bfb036c4abff99b56ac5fcec1a0b11426cd460ed
|
4
|
+
data.tar.gz: dfaffe0196f5c566cec83ff90a577c66789863a7c5b3f2acbf9bfaf70d9a11e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 186108e84103aa0dbf47a54312ca3b6c07381fce30cc9529b8150043b4fdfdb1f607186753866767d4399d224d02948ccca1e2b0f3896be20714b9700cd0e663
|
7
|
+
data.tar.gz: d0bf44fbf1a5f9b2517e7a125888decf92fb0aaaa4456a2ccf27a47ba963423a01321a762fe372ae8e602b12b20aa2e09f2104a16740bfb3d9e8a4817d59e516
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
moiristo-tileup (1.0.
|
4
|
+
moiristo-tileup (1.0.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
coderay (1.1.
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
coderay (1.1.2)
|
10
|
+
metaclass (0.0.4)
|
11
|
+
method_source (0.9.0)
|
12
|
+
mini_magick (4.8.0)
|
13
|
+
minitest (5.11.3)
|
14
|
+
mocha (1.3.0)
|
15
|
+
metaclass (~> 0.0.1)
|
16
|
+
pry (0.11.3)
|
14
17
|
coderay (~> 1.1.0)
|
15
|
-
method_source (~> 0.
|
16
|
-
slop (~> 3.4)
|
18
|
+
method_source (~> 0.9.0)
|
17
19
|
rake (10.5.0)
|
18
20
|
rmagick (2.16.0)
|
19
|
-
slop (3.6.0)
|
20
21
|
|
21
22
|
PLATFORMS
|
22
23
|
ruby
|
@@ -25,10 +26,11 @@ DEPENDENCIES
|
|
25
26
|
bundler (~> 1.13)
|
26
27
|
mini_magick (~> 4.7)
|
27
28
|
minitest (~> 5.10)
|
29
|
+
mocha
|
28
30
|
moiristo-tileup!
|
29
31
|
pry
|
30
32
|
rake (~> 10.0)
|
31
33
|
rmagick (~> 2.16)
|
32
34
|
|
33
35
|
BUNDLED WITH
|
34
|
-
1.
|
36
|
+
1.16.1
|
data/{LICENCE.txt → LICENSE.txt}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -8,7 +8,10 @@
|
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
|
-
|
11
|
+
* Manual:
|
12
|
+
* `gem install moiristo-tileup`
|
13
|
+
* Gemfile:
|
14
|
+
* `gem 'moiristo-tileup', require: 'tileup'`
|
12
15
|
|
13
16
|
`tileup` requires `rmagick` or `mini_magick` for image manipulation, which depends on `imagemagick`. `imagemagick` is avaliable through `homebrew`.
|
14
17
|
|
data/Rakefile
CHANGED
data/lib/tileup/tiler.rb
CHANGED
@@ -26,7 +26,12 @@ module TileUp
|
|
26
26
|
self.logger = TileUp::Logger.build(options.logger, :info, verbose: options.verbose)
|
27
27
|
self.image_processor = TileUp::ImageProcessor.build(options.processor, logger)
|
28
28
|
self.image = image_processor.open(image_filename)
|
29
|
-
|
29
|
+
|
30
|
+
self.extension = if File.exist?(image_filename)
|
31
|
+
File.extname(image_filename)
|
32
|
+
else
|
33
|
+
File.extname(URI(image_filename).path)
|
34
|
+
end
|
30
35
|
|
31
36
|
%w(tile_width tile_height).each{|dimension| options[dimension] = options[dimension].to_i }
|
32
37
|
|
@@ -102,7 +107,7 @@ module TileUp
|
|
102
107
|
logger.info "Tiling image into columns: #{num_columns}, rows: #{num_rows}"
|
103
108
|
|
104
109
|
crops_for(num_columns, num_rows).map do |crop|
|
105
|
-
filename = "#{filename_prefix}_#{crop[:column]}_#{crop[:row]}
|
110
|
+
filename = "#{filename_prefix}_#{crop[:column]}_#{crop[:row]}#{extension}"
|
106
111
|
is_edge = (crop[:row] == num_rows - 1 || crop[:column] == num_columns - 1)
|
107
112
|
image_processor.crop_and_save(base_image, crop, filename: filename, extend_crop: options.extend_incomplete_tiles && is_edge, extend_color: options.extend_color)
|
108
113
|
filename
|
data/lib/tileup/version.rb
CHANGED
data/tileup.gemspec
CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
27
27
|
spec.add_development_dependency 'minitest', '~> 5.10'
|
28
28
|
spec.add_development_dependency 'pry'
|
29
|
+
spec.add_development_dependency 'mocha'
|
29
30
|
|
30
31
|
spec.add_development_dependency 'rmagick', '~> 2.16'
|
31
32
|
spec.add_development_dependency 'mini_magick', '~> 4.7'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moiristo-tileup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reinier de Lange
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: mocha
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rmagick
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,7 +120,7 @@ files:
|
|
106
120
|
- CHANGES.md
|
107
121
|
- Gemfile
|
108
122
|
- Gemfile.lock
|
109
|
-
-
|
123
|
+
- LICENSE.txt
|
110
124
|
- README.md
|
111
125
|
- Rakefile
|
112
126
|
- bin/tileup
|
@@ -140,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
154
|
version: '0'
|
141
155
|
requirements: []
|
142
156
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.7.5
|
144
158
|
signing_key:
|
145
159
|
specification_version: 4
|
146
160
|
summary: Turn an image into an X,Y tile set for use with JS mapping libraries
|