sogoumap2pdf 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,3 +11,7 @@
11
11
  * 1 major enhancement:
12
12
  * Change command syntax
13
13
 
14
+ == 0.0.8 2008-08-19
15
+ * 1 bug fixed:
16
+ * Page size error
17
+
@@ -1,7 +1,4 @@
1
1
 
2
2
  For more information on sogoumap2pdf, see http://sogoumap2pdf.rubyforge.org
3
3
 
4
- NOTE: Change this information in PostInstall.txt
5
- You can also delete it if you don't want it.
6
-
7
4
 
@@ -51,7 +51,7 @@ option=ARGV[4]
51
51
  x,y=ARGV[1].split("x")
52
52
  r,c=ARGV[2].split("x")
53
53
  g=SogouMapImage.new(link, option)
54
- gmpdf=ImageToPdf.new(".JPG")
54
+ gmpdf=ImageToPdf.new(".JPG",x,y)
55
55
  xres, yres = gmpdf.perfect_fit(x.to_i,y.to_i,r.to_i,c.to_i)
56
56
  g.fill_map(xres,yres)
57
57
  gmpdf.front_page(g)
@@ -7,12 +7,12 @@ include Magick
7
7
 
8
8
  module Sogoumap2pdf
9
9
  class ImageToPdf
10
- def initialize(link_end)
10
+ def initialize(link_end,page_width,page_height)
11
11
  #@page_width=600
12
- @page_width=1280
12
+ @page_width=page_width.to_i
13
13
  #@page_width=800
14
14
  #@page_height=768
15
- @page_height=1024
15
+ @page_height=page_height.to_i
16
16
  #@page_height=480
17
17
  @page_overlap=50
18
18
  @text_height=15
@@ -6,40 +6,13 @@ require 'uri'
6
6
  require 'RMagick'
7
7
  include Magick
8
8
 
9
- # provides an access to google map
9
+ # provides an access to sogou map
10
10
  # emulates it as an image
11
11
  #
12
12
  # must be initialised by a link to an image from map.sogou.com
13
13
  #
14
- # http://hbpic3.go2map.com/seamless/0/180/792/504/105/100920_21058.JPG satellite
15
- # http://hbpic2.go2map.com/seamless/0/180/792/504/105/100918_21057.JPG
16
- # http://hbpic2.go2map.com/seamless/0/179/792/504/105/100855_21032.PNG path
17
- # zoom out
18
- # http://pic4.go2map.com/seamless/0/174/711/252/52/50460_10529.GIF map
19
- # http://hbpic3.go2map.com/seamless/0/180/711/252/52/50460_10528.JPG
20
- # http://hbpic0.go2map.com/seamless/0/179/711/252/52/50456_10530.PNG
21
- # home:
22
- # http://hbpic0.go2map.com/seamless/0/180/792/504/105/100960_21035.JPG
23
- # link=head+type+middle+x+_+y+end
24
- # link_beginning=head+type+middle
25
- # link_type:
26
- # satellite /0/180/
27
- # path /0/179/
28
- # map /0/174/
29
14
  # command syntax:
30
- # ruby2map link nh256 nw256 row column savefilename option(s/sp/m)
31
- # ruby map2pdf.rb http://hbpic3.go2map.com/seamless/0/180/711/252/52/50460_10528.JPG 0 0 1 1 save.pdf s
32
- # ruby map2pdf.rb http://hbpic3.go2map.com/seamless/0/180/792/504/105/100855_21032.JPG 0 0 1 1 save.pdf sp
33
- # ruby map2pdf.rb http://pic4.go2map.com/seamless/0/174/711/252/52/50460_10529.GIF 0 0 2 2 save.pdf m
34
- # guangzhou: ruby map2pdf.rb http://hbpic3.go2map.com/seamless/0/180/792/504/105/100899_21033.JPG 0 0 30 30 guangzhou.pdf sp
35
- # output example:
36
- # ruan@nst-server:~/sogoumap2pdf$ ruby map2pdf.rb http://hbpic3.go2map.com/seamless/0/180/711/252/52/50460_10528.JPG 1 1 test.pdf s
37
- # "http://hbpic3.go2map.com/seamless"
38
- # "/0/180/"
39
- # "711/252/52/"
40
- # "getting -2 -1 http://hbpic3.go2map.com/seamless/0/180/711/252/52/50458_10529.JPG"
41
- # "200"
42
- # http://hbpic3.go2map.com/seamless/0/type/level/x200/y200/x_y.JPG
15
+ # guangzhou: sogoumap2pdf http://hbpic3.go2map.com/seamless/0/180/792/504/105/100899_21033.JPG 1024x768 3x3 guangzhou.pdf sp
43
16
  module Sogoumap2pdf
44
17
  class SogouMapImage
45
18
  attr_reader :link_end, :satellite_path, :start_link_x, :start_link_y, :picture_directory_name, :path_directory_name, :npx, :npy, :area_width, :area_height,:resource_type,:resource_level,:resource_extension
@@ -2,7 +2,7 @@ module Sogoumap2pdf
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 7
5
+ TINY = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -3,6 +3,8 @@
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
5
  <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
6
+
7
+ <meta name="verify-v1" content="Fnrqlzk+VkvNYZdIIdYzmjwNXSv1sjlsXAUIHBF2bT0=" />
6
8
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
9
  <title>
8
10
  sogoumap2pdf
@@ -33,39 +35,36 @@
33
35
  <h1>sogoumap2pdf</h1>
34
36
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/sogoumap2pdf"; return false'>
35
37
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/sogoumap2pdf" class="numbers">0.0.1</a>
38
+ <a href="http://rubyforge.org/projects/sogoumap2pdf" class="numbers">0.0.8</a>
37
39
  </div>
38
- <h1>&amp;#x2192; &#8216;sogoumap2pdf&#8217;</h1>
39
- <h2>What</h2>
40
+ <h2>What</h2>
41
+ <p>download map from map.sogou.com and convert to pdf</p>
40
42
  <h2>Installing</h2>
41
43
  <p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">sogoumap2pdf</span></pre></p>
42
44
  <h2>The basics</h2>
43
- <h2>Demonstration of usage</h2>
44
- <h2>Forum</h2>
45
- <p><a href="http://groups.google.com/group/sogoumap2pdf">http://groups.google.com/group/sogoumap2pdf</a></p>
46
- <p><span class="caps">TODO</span> &#8211; create Google Group &#8211; sogoumap2pdf</p>
47
- <h2>How to submit patches</h2>
48
- <p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
49
- <p><span class="caps">TODO</span> &#8211; pick <span class="caps">SVN</span> or Git instructions</p>
50
- <p>The trunk repository is <code>svn://rubyforge.org/var/svn/sogoumap2pdf/trunk</code> for anonymous access.</p>
51
- <p><span class="caps">OOOORRRR</span></p>
52
- <p>You can fetch the source from either:</p>
53
45
  <ul>
54
- <li>rubyforge: <span class="caps">MISSING</span> IN <span class="caps">ACTION</span></li>
46
+ <li>Find out the link for center image of the map(using Firebug for Firefox)</li>
47
+ <li>Generate the pdf map using command sogoumap2pdf</li>
48
+ <li>The command syntax for sogoumap2pdf:<br />
49
+ sogoumap2pdf link x_pixels x y_pixels row x column save_file.pdf &lt;s|sp|m&gt;
50
+ <ul>
51
+ <li>s is for satellite picture only</li>
52
+ <li>sp is for both satellite and path info</li>
53
+ <li>m is for a normal map</li>
54
+ </ul></li>
55
55
  </ul>
56
- <p><span class="caps">TODO</span> &#8211; You can not created a RubyForge project, OR have not run <code>rubyforge config</code><br />
57
- yet to refresh your local rubyforge data with this projects&#8217; id information.</p>
58
- <p>When you do this, this message will magically disappear!</p>
59
- <p>Or you can hack website/index.txt and make it all go away!!</p>
56
+ <h2>Demonstration of usage</h2>
60
57
  <ul>
61
- <li>github: <a href="http://github.com/GITHUB_USERNAME/sogoumap2pdf/tree/master">http://github.com/GITHUB_USERNAME/sogoumap2pdf/tree/master</a></li>
58
+ <li>sogoumap2pdf http://hbpic3.go2map.com/seamless/0/180/711/252/52/50460_10528.JP 800&#215;600 3&#215;3 test.pdf sp</li>
59
+ <li><a href="http://rubyforge.org/frs/download.php/41583/guangzhou.pdf">Example map</a></li>
62
60
  </ul>
63
- <pre>git clone git://github.com/GITHUB_USERNAME/sogoumap2pdf.git</pre>
64
- <p><span class="caps">TODO</span> &#8211; add &#8220;github_username: username&#8221; to ~/.rubyforge/user-config.yml and newgem will reuse it for future projects.</p>
61
+ <p>The trunk repository is <code>git://rubyforge.org/sogoumap2pdf.git</code> for anonymous access.</p>
62
+ <p><span class="caps">OOOORRRR</span></p>
63
+ <p>You can fetch the source from:</p>
65
64
  <ul>
66
- <li>gitorious: <a href="git://gitorious.org/sogoumap2pdf/mainline.git">git://gitorious.org/sogoumap2pdf/mainline.git</a></li>
65
+ <li>rubyforge: <a href="http://rubyforge.org/scm/?group_id=6825">http://rubyforge.org/scm/?group_id=6825</a></li>
67
66
  </ul>
68
- <pre>git clone git://gitorious.org/sogoumap2pdf/mainline.git</pre>
67
+ <pre>git clone git://rubyforge.org/sogoumap2pdf.git</pre>
69
68
  <h3>Build and test instructions</h3>
70
69
  <pre>cd sogoumap2pdf
71
70
  rake test
@@ -73,9 +72,9 @@ rake install_gem</pre>
73
72
  <h2>License</h2>
74
73
  <p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
75
74
  <h2>Contact</h2>
76
- <p>Comments are welcome. Send an email to <a href="mailto:FIXME"><span class="caps">FIXME</span> full name</a> email via the <a href="http://groups.google.com/group/sogoumap2pdf">forum</a></p>
75
+ <p>Comments are welcome. Send an email to <a href="mailto:ruanwz@gmail.com">David Ruan</a></p>
77
76
  <p class="coda">
78
- <a href="FIXME email">FIXME full name</a>, 19th August 2008<br>
77
+ <a href="mailto:ruanwz@gmail.com">David Ruan</a>, 26th August 2008<br>
79
78
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
80
79
  </p>
81
80
  </div>
@@ -1,40 +1,34 @@
1
1
  h1. sogoumap2pdf
2
2
 
3
- h1. &#x2192; 'sogoumap2pdf'
4
-
5
-
6
3
  h2. What
7
4
 
5
+ download map from map.sogou.com and convert to pdf
8
6
 
9
7
  h2. Installing
10
8
 
11
9
  <pre syntax="ruby">sudo gem install sogoumap2pdf</pre>
12
10
 
13
11
  h2. The basics
14
-
12
+ * Find out the link for center image of the map(using Firebug for Firefox)
13
+ * Generate the pdf map using command sogoumap2pdf
14
+ * The command syntax for sogoumap2pdf:
15
+ sogoumap2pdf link x_pixels x y_pixels row x column save_file.pdf <s|sp|m>
16
+ ** s is for satellite picture only
17
+ ** sp is for both satellite and path info
18
+ ** m is for a normal map
15
19
 
16
20
  h2. Demonstration of usage
17
21
 
22
+ * sogoumap2pdf http://hbpic3.go2map.com/seamless/0/180/711/252/52/50460_10528.JP 800x600 3x3 test.pdf sp
23
+ * "Example map":http://rubyforge.org/frs/download.php/41583/guangzhou.pdf
18
24
 
19
-
20
- h2. Forum
21
-
22
- "http://groups.google.com/group/sogoumap2pdf":http://groups.google.com/group/sogoumap2pdf
23
-
24
- TODO - create Google Group - sogoumap2pdf
25
-
26
- h2. How to submit patches
27
-
28
- Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
29
-
30
- TODO - pick SVN or Git instructions
31
-
32
- The trunk repository is <code>svn://rubyforge.org/var/svn/sogoumap2pdf/trunk</code> for anonymous access.
25
+ The trunk repository is <code>git://rubyforge.org/sogoumap2pdf.git</code> for anonymous access.
33
26
 
34
27
  OOOORRRR
35
28
 
36
- You can fetch the source from either:
29
+ You can fetch the source from:
37
30
 
31
+ <% rubyforge_project_id="6825" %>
38
32
  <% if rubyforge_project_id %>
39
33
 
40
34
  * rubyforge: "http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>":http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>
@@ -54,18 +48,6 @@ Or you can hack website/index.txt and make it all go away!!
54
48
 
55
49
  <% end %>
56
50
 
57
- * github: "http://github.com/GITHUB_USERNAME/sogoumap2pdf/tree/master":http://github.com/GITHUB_USERNAME/sogoumap2pdf/tree/master
58
-
59
- <pre>git clone git://github.com/GITHUB_USERNAME/sogoumap2pdf.git</pre>
60
-
61
-
62
- TODO - add "github_username: username" to ~/.rubyforge/user-config.yml and newgem will reuse it for future projects.
63
-
64
-
65
- * gitorious: "git://gitorious.org/sogoumap2pdf/mainline.git":git://gitorious.org/sogoumap2pdf/mainline.git
66
-
67
- <pre>git clone git://gitorious.org/sogoumap2pdf/mainline.git</pre>
68
-
69
51
  h3. Build and test instructions
70
52
 
71
53
  <pre>cd sogoumap2pdf
@@ -79,5 +61,4 @@ This code is free to use under the terms of the MIT license.
79
61
 
80
62
  h2. Contact
81
63
 
82
- Comments are welcome. Send an email to "FIXME full name":mailto:FIXME email via the "forum":http://groups.google.com/group/sogoumap2pdf
83
-
64
+ Comments are welcome. Send an email to "David Ruan":mailto:ruanwz@gmail.com
@@ -3,6 +3,8 @@
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
5
  <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
6
+
7
+ <meta name="verify-v1" content="Fnrqlzk+VkvNYZdIIdYzmjwNXSv1sjlsXAUIHBF2bT0=" />
6
8
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
9
  <title>
8
10
  <%= title %>
@@ -37,7 +39,7 @@
37
39
  </div>
38
40
  <%= body %>
39
41
  <p class="coda">
40
- <a href="FIXME email">FIXME full name</a>, <%= modified.pretty %><br>
42
+ <a href="mailto:ruanwz@gmail.com">David Ruan</a>, <%= modified.pretty %><br>
41
43
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
42
44
  </p>
43
45
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sogoumap2pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ruan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-21 00:00:00 -05:00
12
+ date: 2008-08-26 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -93,9 +93,6 @@ post_install_message: |+
93
93
 
94
94
  For more information on sogoumap2pdf, see http://sogoumap2pdf.rubyforge.org
95
95
 
96
- NOTE: Change this information in PostInstall.txt
97
- You can also delete it if you don't want it.
98
-
99
96
 
100
97
  rdoc_options:
101
98
  - --main