imagetiler 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +3 -3
- data/VERSION +1 -1
- data/imagetiler.gemspec +3 -3
- data/{imagetiler.rb → lib/imagetiler.rb} +5 -0
- metadata +5 -5
data/README.markdown
CHANGED
@@ -23,9 +23,9 @@ Install the gem:
|
|
23
23
|
`gem install imagetiler`
|
24
24
|
|
25
25
|
Use it in your code:
|
26
|
-
|
27
|
-
t = Tiler.new
|
28
|
-
t.make_tiles(image_source, opts)
|
26
|
+
require 'imagetiler'
|
27
|
+
t = Tiler.new
|
28
|
+
t.make_tiles(image_source, opts)
|
29
29
|
|
30
30
|
`image_source` can be either a filename or an RMagick Image.
|
31
31
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/imagetiler.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{imagetiler}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Anna, Guilhem Vellut"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-04}
|
13
13
|
s.description = %q{imagetiler is a simple command-line and ruby image tiler with support for multiple zoom levels and different image formats.}
|
14
14
|
s.email = %q{tanna22@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
"Rakefile",
|
21
21
|
"VERSION",
|
22
22
|
"imagetiler.gemspec",
|
23
|
-
"imagetiler.rb"
|
23
|
+
"lib/imagetiler.rb"
|
24
24
|
]
|
25
25
|
s.homepage = %q{http://github.com/fofanafi/imagetiler}
|
26
26
|
s.rdoc_options = ["--charset=UTF-8"]
|
@@ -59,6 +59,7 @@ class Tiler
|
|
59
59
|
image_sq = pad_image(image)
|
60
60
|
image_length = image_sq.columns
|
61
61
|
|
62
|
+
# the actual tiling part!
|
62
63
|
zoom_levels.each do |zoom|
|
63
64
|
# get the number of tiles in each column and row
|
64
65
|
factor = 2 ** zoom
|
@@ -68,10 +69,14 @@ class Tiler
|
|
68
69
|
|
69
70
|
0.upto(factor-1) do |col|
|
70
71
|
0.upto(factor-1) do |row|
|
72
|
+
|
73
|
+
# cut tile
|
71
74
|
# Image.crop(x,y,width,height,toss offset information)
|
72
75
|
tile = image_sq.crop(col*tile_length, row*tile_length,
|
73
76
|
tile_length, tile_length, true)
|
74
77
|
tile.resize!(TILE_SIZE,TILE_SIZE)
|
78
|
+
|
79
|
+
# output tile
|
75
80
|
tile.write("#{@output_dir}/#{prefix}_#{zoom}_#{col}_#{row}.#{@format}")
|
76
81
|
end
|
77
82
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imagetiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Anna, Guilhem Vellut
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-04 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -32,7 +32,7 @@ files:
|
|
32
32
|
- Rakefile
|
33
33
|
- VERSION
|
34
34
|
- imagetiler.gemspec
|
35
|
-
- imagetiler.rb
|
35
|
+
- lib/imagetiler.rb
|
36
36
|
has_rdoc: true
|
37
37
|
homepage: http://github.com/fofanafi/imagetiler
|
38
38
|
licenses: []
|