imagetiler 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +23 -15
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/imagetiler.gemspec +4 -1
- metadata +18 -5
data/README.markdown
CHANGED
@@ -5,7 +5,7 @@ imagetiler is a simple command-line and ruby image tiler with support for multip
|
|
5
5
|
|
6
6
|
## How to use
|
7
7
|
|
8
|
-
|
8
|
+
### From the command line
|
9
9
|
|
10
10
|
`ruby tile_image.rb -o OUTPUT_DIR -z ZOOM_LEVELS IMAGE_FILE`
|
11
11
|
|
@@ -14,9 +14,16 @@ For example
|
|
14
14
|
`ruby tile_image.rb -o ./tiles -z 2..4 ./input_files/map.jpg`
|
15
15
|
|
16
16
|
|
17
|
-
|
17
|
+
### From ruby
|
18
18
|
|
19
|
-
|
19
|
+
Install ImageMagick.
|
20
|
+
|
21
|
+
Install the gem:
|
22
|
+
`gem install rmagick`
|
23
|
+
`gem install imagetiler`
|
24
|
+
|
25
|
+
Use it in your code:
|
26
|
+
`require 'imagetiler'
|
20
27
|
t = Tiler.new
|
21
28
|
t.make_tiles(image_source, opts)`
|
22
29
|
|
@@ -27,14 +34,24 @@ You can set options two ways:
|
|
27
34
|
or
|
28
35
|
`t.get_tiles(image, :zoom_levels => 2..4)`
|
29
36
|
|
30
|
-
|
37
|
+
If you set an option in get_tiles, that will be the new default for that instance of Tiler.
|
38
|
+
|
39
|
+
|
40
|
+
## Options
|
41
|
+
|
42
|
+
`zoom_levels` : Zoom level 0 shows the entire image as one 256x256 tile. Subsequent zoom levels double both the horizontal and vertical sides. Default is 0..4
|
43
|
+
`output_dir` : Defaults to the current directory. Don't include the ending '/'
|
44
|
+
`bg_color` : The background fill color, transparent by default.
|
45
|
+
`autocreate_dirs` : Whether or not to create the directory if it exists. Default true
|
46
|
+
`format` : The format for the output, defaults to 'jpg'. Can be png, gif, or anything that ImageMagick supports.
|
47
|
+
`prefix` : Prefix for the output files. Defaults to 'tile'
|
31
48
|
|
32
49
|
|
33
50
|
## Methods
|
34
51
|
|
35
52
|
`make_tiles(image_source, opts)`
|
36
53
|
|
37
|
-
`calc_native_res_zoom` : Calculates the zoom level closest to native resolution. Returns a float for the zoom -- so, use zoom.round if you want the closest zoom level, for example
|
54
|
+
`calc_native_res_zoom` : Calculates the zoom level closest to native resolution. Returns a float for the zoom -- so, use zoom.round if you want the closest zoom level, for example.
|
38
55
|
|
39
56
|
|
40
57
|
## Output
|
@@ -42,17 +59,8 @@ Tiles in the output folder with format
|
|
42
59
|
`#{output_dir}/#{prefix}_#{zoom_level}_#{tile_col}_#{tile_row}.#{image_format}`
|
43
60
|
|
44
61
|
|
45
|
-
## Options
|
46
|
-
|
47
|
-
`zoom_levels` : Zoom level 0 shows the entire image as one 256x256 tile. Subsequent zoom levels double both the horizontal and vertical sides. Default is 0..4
|
48
|
-
`output_dir` : Defaults to the current directory. Don't include the ending '/'
|
49
|
-
`bg_color` : The background fill color, transparent by default.
|
50
|
-
`autocreate_dirs` : Whether or not to create the directory if it exists. Default true
|
51
|
-
`format` : The format for the output, defaults to 'jpg'. Can be png, gif, etc.
|
52
|
-
`prefix` : Prefix for the output files. Defaults to 'tile'
|
53
|
-
|
54
62
|
## Other things
|
55
|
-
* Requires rmagick.
|
63
|
+
* Requires rmagick and ImageMagick.
|
56
64
|
* Might not work on Windows as written -- change the '/' for the output to '\\'
|
57
65
|
|
58
66
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/imagetiler.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
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.1"
|
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"]
|
@@ -33,9 +33,12 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.specification_version = 3
|
34
34
|
|
35
35
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
36
|
+
s.add_runtime_dependency(%q<rmagick>, [">= 0"])
|
36
37
|
else
|
38
|
+
s.add_dependency(%q<rmagick>, [">= 0"])
|
37
39
|
end
|
38
40
|
else
|
41
|
+
s.add_dependency(%q<rmagick>, [">= 0"])
|
39
42
|
end
|
40
43
|
end
|
41
44
|
|
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: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Anna, Guilhem Vellut
|
@@ -17,8 +17,21 @@ cert_chain: []
|
|
17
17
|
|
18
18
|
date: 2010-08-31 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
|
-
dependencies:
|
21
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rmagick
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
22
35
|
description: imagetiler is a simple command-line and ruby image tiler with support for multiple zoom levels and different image formats.
|
23
36
|
email: tanna22@gmail.com
|
24
37
|
executables: []
|