<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -140,10 +140,12 @@ module Prawn
       color_space = case jpg.channels
       when 1
         :DeviceGray
+      when 3
+        :DeviceRGB
       when 4
         :DeviceCMYK
       else
-        :DeviceRGB
+        raise ArgumentError, 'JPG uses an unsupported number of channels'
       end
       obj = ref(:Type       =&gt; :XObject,
           :Subtype          =&gt; :Image,
@@ -153,6 +155,14 @@ module Prawn
           :Width            =&gt; jpg.width,
           :Height           =&gt; jpg.height,
           :Length           =&gt; data.size ) 
+
+      # add extra decode params for CMYK images. By swapping the
+      # min and max values from the default, we invert the colours. See
+      # section 4.8.4 of the spec.
+      if color_space == :DeviceCMYK
+        obj.data[:Decode] = [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ]
+      end
+
       obj &lt;&lt; data
       return obj
     end</diff>
      <filename>lib/prawn/images.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0c97cc776ab65adc50e317768a6c3cc246cca9ed</id>
    </parent>
  </parents>
  <author>
    <name>James Healy</name>
    <email>jimmy@deefa.com</email>
  </author>
  <url>http://github.com/sandal/prawn/commit/827887ea2e1ca845a07af46241c83050440ae35e</url>
  <id>827887ea2e1ca845a07af46241c83050440ae35e</id>
  <committed-date>2008-10-31T08:32:37-07:00</committed-date>
  <authored-date>2008-10-31T08:32:37-07:00</authored-date>
  <message>Set an explicit Decode Array for CMYK jpg images
- see section 4.8.4 of the spec. We're swapping Dmin and Dmax to invert
  colours.</message>
  <tree>0a660c4ca4117d40dc34d905ef10a0fae73443dc</tree>
  <committer>
    <name>James Healy</name>
    <email>jimmy@deefa.com</email>
  </committer>
</commit>
