public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
Added scaled_width and scaled_height to info returned by image() method
trym (author)
Wed Oct 29 12:01:04 -0700 2008
commit  e020ec959dde98a510d030eea099a40e9819ee0b
tree    ff54224c321e1d17ff3ee314ceb4376ca6600771
parent  cd63dfb9424292cc3dcd97dcce0fb55349ce4dc8
...
87
88
89
90
 
91
92
93
...
288
289
290
 
 
291
292
293
...
87
88
89
 
90
91
92
93
...
288
289
290
291
292
293
294
295
0
@@ -87,7 +87,7 @@ module Prawn
0
 
0
       # find where the image will be placed and how big it will be  
0
       w,h = calc_image_dimensions(info, options)
0
-      
0
+
0
       if options[:at]       
0
         x,y = translate(options[:at]) 
0
       else                  
0
@@ -288,6 +288,8 @@ module Prawn
0
           w = bh * ip
0
         end
0
       end
0
+      info.scaled_width = w
0
+      info.scaled_height = h
0
       [w,h]
0
     end
0
 
...
14
15
16
17
 
 
18
19
20
...
14
15
16
 
17
18
19
20
21
0
@@ -14,7 +14,8 @@ module Prawn
0
     # of a PNG image that we need to embed them in a PDF
0
     class JPG 
0
       attr_reader :width, :height, :bits, :channels
0
-
0
+      attr_accessor :scaled_width, :scaled_height
0
+      
0
       JPEG_SOF_BLOCKS = %W(\xc0 \xc1 \xc2 \xc3 \xc5 \xc6 \xc7 \xc9 \xca \xcb \xcd \xce \xcf)
0
       JPEG_APP_BLOCKS = %W(\xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef)
0
 
...
19
20
21
22
 
 
23
24
25
...
19
20
21
 
22
23
24
25
26
0
@@ -19,7 +19,8 @@ module Prawn
0
       attr_reader :width, :height, :bits
0
       attr_reader :color_type, :compression_method, :filter_method
0
       attr_reader :interlace_method, :alpha_channel
0
-
0
+      attr_accessor :scaled_width, :scaled_height
0
+      
0
       # Process a new PNG image
0
       #
0
       # <tt>:data</tt>:: A string containing a full PNG file

Comments