map_print 1.1.0 → 1.2.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/map_print/pdf_handler.rb +18 -5
- data/lib/map_print/png_handler.rb +11 -2
- data/lib/map_print/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc968d11e40e86fdaa3559d6093c39f994f9ae41
|
4
|
+
data.tar.gz: 9659ed13e55f82993d8e386715ea2cfb42f25d79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88d26aaac1871cdc2402c2977d28abe57e6394a34c4a0e0b4eb6fca0866bd086d2eac8393fae1ec457a03e2a593343e771b06fde41badba10694370001732479
|
7
|
+
data.tar.gz: bca0ee97779b4917a6e972353f4ceeff84a8678485a5435c26d91c2058f0edb252b78fd7d8d81c5b414da1388c111efd693ed43344c456dc14527d0ae999f40f
|
data/Gemfile.lock
CHANGED
@@ -33,14 +33,27 @@ module MapPrint
|
|
33
33
|
private
|
34
34
|
def print_map
|
35
35
|
map_image = @context.print_layers
|
36
|
-
map_image = @context.print_geojson(MiniMagick::Image.new(map_image.path))
|
37
36
|
|
38
|
-
size = @context.map[:size]
|
39
|
-
|
40
|
-
size[:
|
37
|
+
size = @context.map[:size]
|
38
|
+
geometry = ''
|
39
|
+
if size && (size[:width] || size[:height])
|
40
|
+
geometry += size[:width].to_s if size[:width]
|
41
|
+
geometry += 'x'
|
42
|
+
geometry += size[:height].to_s if size[:height]
|
43
|
+
|
44
|
+
image = MiniMagick::Image.new(map_image.path)
|
45
|
+
image.combine_options do |c|
|
46
|
+
c.density 300
|
47
|
+
c.resize geometry
|
48
|
+
c.unsharp '1.5x1+0.7+0.02'
|
49
|
+
end
|
50
|
+
image.write map_image.path
|
51
|
+
end
|
52
|
+
|
53
|
+
map_image = @context.print_geojson(MiniMagick::Image.new(map_image.path))
|
41
54
|
|
42
55
|
position = @context.map[:position] || {}
|
43
|
-
@pdf.image map_image.path, at: [position[:x] || 0, @pdf.bounds.top - (position[:y] || 0)]
|
56
|
+
@pdf.image map_image.path, at: [position[:x] || 0, @pdf.bounds.top - (position[:y] || 0)]
|
44
57
|
end
|
45
58
|
|
46
59
|
def print_image(image_path, position)
|
@@ -34,7 +34,6 @@ module MapPrint
|
|
34
34
|
|
35
35
|
def print_map
|
36
36
|
map_image = @context.print_layers
|
37
|
-
map_image = @context.print_geojson(MiniMagick::Image.new(map_image.path))
|
38
37
|
|
39
38
|
size = @context.map[:size]
|
40
39
|
geometry = ''
|
@@ -42,9 +41,19 @@ module MapPrint
|
|
42
41
|
geometry += size[:width].to_s if size[:width]
|
43
42
|
geometry += 'x'
|
44
43
|
geometry += size[:height].to_s if size[:height]
|
44
|
+
|
45
|
+
image = MiniMagick::Image.new(map_image.path)
|
46
|
+
image.combine_options do |c|
|
47
|
+
c.density 300
|
48
|
+
c.resize geometry
|
49
|
+
c.unsharp '1.5x1+0.7+0.02'
|
50
|
+
end
|
51
|
+
image.write map_image.path
|
45
52
|
end
|
46
53
|
|
47
|
-
|
54
|
+
map_image = @context.print_geojson(MiniMagick::Image.new(map_image.path))
|
55
|
+
|
56
|
+
overlay_image(map_image, @context.map[:position])
|
48
57
|
end
|
49
58
|
|
50
59
|
private
|
data/lib/map_print/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: map_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Fast
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|