{"issue":{"milestone":null,"user":{"id":200725,"login":"chanind","url":"https://api.github.com/users/chanind","avatar_url":"https://secure.gravatar.com/avatar/0a7f07ece6764ad8f97936ef14bee2f2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"0a7f07ece6764ad8f97936ef14bee2f2"},"title":"Cannot convert multipage PDFs to JPG with RMagick","created_at":"2011-11-05T01:55:40Z","labels":[],"updated_at":"2011-12-18T18:50:22Z","state":"open","id":2150296,"html_url":"https://github.com/jnicklas/carrierwave/issues/517","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"When using process :convert => 'jpg' on a multipage PDF carrierwave throws a LocaJumpError. The reason is that convert calls manipulate!, but does not pass in a block.\r\n\r\nA possible solution is to replace the current manipulate! method under / lib / carrierwave / processing / rmagick.rb with the following:\r\n\r\n```ruby\r\n    def manipulate!(options={})\r\n      cache_stored_file! if !cached?\r\n      image = ::Magick::Image.read(current_path)\r\n\r\n      frames = if image.size > 1\r\n        list = ::Magick::ImageList.new\r\n        image.each do |frame|\r\n            list << (block_given? ? yield( frame ) : frame)\r\n        end\r\n        block_given? ? list : list.append(true)\r\n      else\r\n        frame = image.first\r\n        frame = yield( frame ) if block_given?\r\n        frame\r\n      end\r\n\r\n      if options[:format]\r\n        frames.write(\"#{options[:format]}:#{current_path}\")\r\n      else\r\n        frames.write(current_path)\r\n      end\r\n      destroy_image(frames)\r\n    rescue ::Magick::ImageMagickError => e\r\n      raise CarrierWave::ProcessingError, I18n.translate(:\"errors.messages.rmagick_processing_error\", :e => e)\r\n    end\r\n```\r\n\r\nThis turns the multipage image into a single page image if no block is provided. Not sure if this is the best solution though as I think multilayer images will not convert properly using this approach (in theory they're just throwing an error on convert though anway...)","number":517,"url":"https://api.github.com/repos/jnicklas/carrierwave/issues/517","comments":5,"assignee":null},"comment":{"user":{"id":175984,"login":"pferdefleisch","url":"https://api.github.com/users/pferdefleisch","avatar_url":"https://secure.gravatar.com/avatar/5012b2e9db5468ca91d34196155f756a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5012b2e9db5468ca91d34196155f756a"},"created_at":"2011-12-18T18:50:22Z","updated_at":"2011-12-18T18:50:22Z","id":3196175,"body":"FYI - I havent pulled from carrierwave master since I created it Nov 21st.","url":"https://api.github.com/repos/jnicklas/carrierwave/issues/comments/3196175"},"action":"created"}