public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
cleanup
sandal (author)
Thu Jul 24 17:24:32 -0700 2008
commit  18e73e1d90f88b2700af91184fd36ff676fe3dae
tree    bc329d120c816b3cd353db3bde3f2a07b228263b
parent  c380909dc5cf96f4ba6888b41f39305d133a0b4e
...
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
 
65
66
 
67
68
 
69
70
 
71
72
 
 
 
 
 
 
 
 
 
 
73
74
75
...
50
51
52
 
 
 
 
 
 
 
 
 
 
 
 
53
54
55
 
56
57
 
58
59
 
60
61
 
62
63
64
65
66
67
68
69
70
71
72
73
74
0
@@ -50,26 +50,25 @@ module Prawn
0
 
0
     private
0
 
0
-    def build_jpg_object(info, size)
0
-      obj = ref(:Type       => :XObject,
0
-                :Subtype    => :Image,
0
-                :ColorSpace => :DeviceRGB,
0
-                :Filter     => :DCTDecode,
0
-                :BitsPerComponent => info.bits,
0
-                :Width   => info.width,
0
-                :Height  => info.height,
0
-                :Length  => size
0
-               )
0
-
0
-      case info.channels
0
+    def build_jpg_object(info, size)  
0
+      color_space = case info.channels
0
       when 1
0
-        obj.data[:ColorSpace] = :DeviceGray
0
+        :DeviceGray
0
       when 4
0
-        obj.data[:ColorSpace] = :DeviceCMYK
0
+        :DeviceCMYK
0
       else
0
-        obj.data[:ColorSpace] = :DeviceRGB
0
+        :DeviceRGB
0
       end
0
-      obj
0
+        
0
+      
0
+      ref(:Type             => :XObject,
0
+          :Subtype          => :Image,     
0
+          :Filter           => :DCTDecode, 
0
+          :ColorSpace       => color_space,
0
+          :BitsPerComponent => info.bits,
0
+          :Width            => info.width,
0
+          :Height           => info.height,
0
+          :Length           => size )   
0
     end
0
 
0
     def next_image_id

Comments