title: Trouble with Carrierwave :convert
body: <p>I'd like <code>Carrierwave</code> to produce a few versions of an image, one in png format, and one in jpeg format, but I can't seem to get it to work. I realize several similar questions have been asked both here and elsewhere, but I've failed to find a solution. Roughly, here's what I have:</p>
  
  <pre><code>class MyUploader &lt; CarrierWave::Uploader::Base
    include CarrierWave::RMagick
  
    version :jpeg do 
      process :convert =&gt; 'jpg'
      # more procesors
      process :processed =&gt; :jpg
    end
  
    version :png do
      process :convert =&gt; 'png'
      # more processors 
      process :processed =&gt; :png
    end
  
    def store_path(for_file = filename)
      if version_name != :png
        return "#{version_name}.jpg"
      else
        return "#{version_name}.png"
      end
    end
  
    def filename
      filename = if version_name != :png
        super != nil ? super.split('.').first + '.jpg' : super
      else 
        super != nil ? super.split('.').first + '.png' : super
      end
    end
  
  end
  </code></pre>
  
  <p>So, regardless of the type of image format I pass in, this produces two files: one named <code>jpg.jpg</code>, and one named <code>png.png</code>. <code>jpg.jpg</code> is indeed always a JPEG file (as verified with Unix's <code>file</code> command), BUT <code>png.png</code> is only a true PNG formated file if and only if I originally pass in a png-formated file (passing in a jpeg results in a jpeg formatted file)!</p>
  
  <p>Ideas?</p>
  
  <p>This might not be useful, but I find the <code>convert</code> method in <code>Carrierwave</code> itself suspicious: <code>convert(some_format)</code> calls <code>manipulate!(:format =&gt; some_format)</code>, which in turn calls <code>(some_image_object).write("#{some_format}:#{current_path}")</code>. Now if the original image passed in is bla.format (format = jpg, png, etc), <code>current_path</code> with have an extension of .format (tested via a monkey-patch on <code>manipulate!</code>). And the way image format conversion works in <code>RMagick</code> is by calling <code>write</code> with an argument having the desired extension. So why would the jpeg conversion above actually take place? And if so, why would the png conversion fail?</p>
  
  <p>Also, if it's useful, I'm on Rails 3.0.9 and Carrierwave 0.5.6</p>
  
  <p>Thanks!</p>