<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Rotating Images With RMagick and Ruby on Rails</title>
	<atom:link href="http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/</link>
	<description>John Nunemaker\'s thoughts and such</description>
	<lastBuildDate>Sun, 01 Nov 2009 17:19:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Cobus</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-149113</link>
		<dc:creator>Cobus</dc:creator>
		<pubDate>Wed, 18 Jun 2008 23:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-149113</guid>
		<description>When using RMagick combined with file_column, after uploading a image using the resize method to created 3 different images my rails server gets a segmentation fault and dies. :( 

When uploading without resizing then it is fine. :) 

I have updated the latest RMagick but still have the same problem, my server is Centos Linux.  

Would anyone know the answer to this?</description>
		<content:encoded><![CDATA[<p>When using RMagick combined with file_column, after uploading a image using the resize method to created 3 different images my rails server gets a segmentation fault and dies. :( </p>
<p>When uploading without resizing then it is fine. :) </p>
<p>I have updated the latest RMagick but still have the same problem, my server is Centos Linux.  </p>
<p>Would anyone know the answer to this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-133457</link>
		<dc:creator>Rajesh</dc:creator>
		<pubDate>Wed, 19 Mar 2008 10:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-133457</guid>
		<description>Thanks for sharing your knowledge</description>
		<content:encoded><![CDATA[<p>Thanks for sharing your knowledge</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Flint</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-130959</link>
		<dc:creator>Matthew Flint</dc:creator>
		<pubDate>Sun, 02 Mar 2008 16:59:13 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-130959</guid>
		<description>Quick tip for anyone wanting to do the same:

RMagick is capable of rotating jpegs in a lossless way, but can only do so for images whose height and width are multiples of 16.

This is why my original images were being rotated losslessly, but the thumbnails were rotated in lossy way. (And it really is noticeable after surprisingly few rotations)

So I changed:

:thumbnails =&gt; { :thumb =&gt; &#039;100x100&gt;&#039;, :reduced =&gt; &#039;500x500&#039; }

to:

:thumbnails =&gt; { :thumb =&gt; &#039;128x128&gt;&#039;, :reduced =&gt; &#039;512x512&#039; }

in my model. Hope that helps someone :-)</description>
		<content:encoded><![CDATA[<p>Quick tip for anyone wanting to do the same:</p>
<p>RMagick is capable of rotating jpegs in a lossless way, but can only do so for images whose height and width are multiples of 16.</p>
<p>This is why my original images were being rotated losslessly, but the thumbnails were rotated in lossy way. (And it really is noticeable after surprisingly few rotations)</p>
<p>So I changed:</p>
<p>:thumbnails =&gt; { :thumb =&gt; &#8216;100&#215;100&gt;&#8217;, :reduced =&gt; &#8216;500&#215;500&#8242; }</p>
<p>to:</p>
<p>:thumbnails =&gt; { :thumb =&gt; &#8216;128&#215;128&gt;&#8217;, :reduced =&gt; &#8216;512&#215;512&#8242; }</p>
<p>in my model. Hope that helps someone :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raj</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-100367</link>
		<dc:creator>Raj</dc:creator>
		<pubDate>Wed, 17 Oct 2007 10:35:59 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-100367</guid>
		<description>Hey, 

I&#039;m following your approach except that I&#039;m using the attachment_fu plugin and storing images in the file system.

So far I have got up to:

def edit
	@logo = Logo.find(params[:id])
	image = @logo.public_filename
	image = Magick::ImageList.new(image)
end

But I get an error saying:

Magick::ImageMagickError in MainController#edit

unable to open image `/logos/0000/0013/s.jpg&#039;: No such file or directory

Any suggestions? Would appreciate any help.

Cheers</description>
		<content:encoded><![CDATA[<p>Hey, </p>
<p>I&#8217;m following your approach except that I&#8217;m using the attachment_fu plugin and storing images in the file system.</p>
<p>So far I have got up to:</p>
<p>def edit<br />
	@logo = Logo.find(params[:id])<br />
	image = @logo.public_filename<br />
	image = Magick::ImageList.new(image)<br />
end</p>
<p>But I get an error saying:</p>
<p>Magick::ImageMagickError in MainController#edit</p>
<p>unable to open image `/logos/0000/0013/s.jpg&#8217;: No such file or directory</p>
<p>Any suggestions? Would appreciate any help.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Nunemaker</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-97059</link>
		<dc:creator>John Nunemaker</dc:creator>
		<pubDate>Tue, 25 Sep 2007 12:30:05 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-97059</guid>
		<description>Search for the attachment_fu rails plugin. It does everything that you are asking.</description>
		<content:encoded><![CDATA[<p>Search for the attachment_fu rails plugin. It does everything that you are asking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mahesh</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-97046</link>
		<dc:creator>mahesh</dc:creator>
		<pubDate>Tue, 25 Sep 2007 11:10:10 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-97046</guid>
		<description>Hello,

I want to do the following -

1. Upload an image,
2. Create an thumbnail of that image.
3. Save the original image in a folder.
4. Save the thumbnail of the image and the path of the original image in a database table.
5. Display the thumbnail and the original image.

How I can do all these ? (using Ruby on Rails)</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I want to do the following -</p>
<p>1. Upload an image,<br />
2. Create an thumbnail of that image.<br />
3. Save the original image in a folder.<br />
4. Save the thumbnail of the image and the path of the original image in a database table.<br />
5. Display the thumbnail and the original image.</p>
<p>How I can do all these ? (using Ruby on Rails)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Nunemaker</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-88408</link>
		<dc:creator>John Nunemaker</dc:creator>
		<pubDate>Thu, 02 Aug 2007 21:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-88408</guid>
		<description>@Julien - Agreed, I wrote this before I really understood what should be in the model and what in the controller.</description>
		<content:encoded><![CDATA[<p>@Julien &#8211; Agreed, I wrote this before I really understood what should be in the model and what in the controller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien Delgoulet</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-88397</link>
		<dc:creator>Julien Delgoulet</dc:creator>
		<pubDate>Thu, 02 Aug 2007 20:11:37 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-88397</guid>
		<description>Hey ! Nice trick ;-)
However, I think , in my opinion, that rotate should be a method of Photo.
Here is what I did : 

class Photo </description>
		<content:encoded><![CDATA[<p>Hey ! Nice trick ;-)<br />
However, I think , in my opinion, that rotate should be a method of Photo.<br />
Here is what I did : </p>
<p>class Photo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Nunemaker</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-11110</link>
		<dc:creator>John Nunemaker</dc:creator>
		<pubDate>Fri, 03 Nov 2006 13:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-11110</guid>
		<description>Thanks for sharing your findings with everyone else.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing your findings with everyone else.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew Noakes</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-11100</link>
		<dc:creator>Drew Noakes</dc:creator>
		<pubDate>Fri, 03 Nov 2006 11:43:51 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-11100</guid>
		<description>Well it seems I&#039;ve solved my problem.  For anyone else who&#039;s interested, here is what I put in my controller:

&lt;code&gt;  require &#039;RMagick&#039;
  include Magick
  def chord_chart
    fill = GradientFill.new(100, 100, 100, 100,&quot;yellow&quot;,&quot;red&quot;)
    img = Image.new(200, 200, fill)
    img.format = &quot;GIF&quot;
    img_content = img.to_blob
    render :text =&gt; img_content, :status =&gt; 200, :content_type =&gt; &#039;image/gif&#039;
  end
&lt;/code&gt;

This creates a simple gradient filled image in the browser.  Woo!  Now, to make the image display something useful...</description>
		<content:encoded><![CDATA[<p>Well it seems I&#8217;ve solved my problem.  For anyone else who&#8217;s interested, here is what I put in my controller:</p>
<p><code>  require 'RMagick'<br />
  include Magick<br />
  def chord_chart<br />
    fill = GradientFill.new(100, 100, 100, 100,"yellow","red")<br />
    img = Image.new(200, 200, fill)<br />
    img.format = "GIF"<br />
    img_content = img.to_blob<br />
    render :text =&gt; img_content, :status =&gt; 200, :content_type =&gt; 'image/gif'<br />
  end<br />
</code></p>
<p>This creates a simple gradient filled image in the browser.  Woo!  Now, to make the image display something useful&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew Noakes</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-11093</link>
		<dc:creator>Drew Noakes</dc:creator>
		<pubDate>Fri, 03 Nov 2006 11:01:13 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-11093</guid>
		<description>Have you tried creating a rails action that returns an image as the HTTP response?  I know how to do this in Java and C#, but as I&#039;m new to Ruby &amp; Rails, I&#039;m out of my comfort zone!

I haven&#039;t seen anywhere that I can control the response headers or response MIME type.  I need to generate an image on-the-fly (possibly with caching, but I can tackle that later).  I have RMagick installed, and can create my Image object.  How do I get it on the response stream?  There&#039;s a &#039;to_blob&#039; method on &#039;Image&#039; that looks useful.

Any suggestions are appreciated :)</description>
		<content:encoded><![CDATA[<p>Have you tried creating a rails action that returns an image as the HTTP response?  I know how to do this in Java and C#, but as I&#8217;m new to Ruby &amp; Rails, I&#8217;m out of my comfort zone!</p>
<p>I haven&#8217;t seen anywhere that I can control the response headers or response MIME type.  I need to generate an image on-the-fly (possibly with caching, but I can tackle that later).  I have RMagick installed, and can create my Image object.  How do I get it on the response stream?  There&#8217;s a &#8216;to_blob&#8217; method on &#8216;Image&#8217; that looks useful.</p>
<p>Any suggestions are appreciated :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby on Rails and Rmagick Crop, Resize, Rotate, Thumbnail and Upload Images</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-7187</link>
		<dc:creator>Ruby on Rails and Rmagick Crop, Resize, Rotate, Thumbnail and Upload Images</dc:creator>
		<pubDate>Sat, 09 Sep 2006 00:34:18 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-7187</guid>
		<description>[...] Rotating Images With RMagick and Ruby on Rails  This is archived from:Here [...]</description>
		<content:encoded><![CDATA[<p>[...] Rotating Images With RMagick and Ruby on Rails  This is archived from:Here [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby on Rails</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-6946</link>
		<dc:creator>Ruby on Rails</dc:creator>
		<pubDate>Tue, 05 Sep 2006 00:13:16 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-6946</guid>
		<description>Nice work. Rmagick can be a lot of fun and you show that here in your tutorial.</description>
		<content:encoded><![CDATA[<p>Nice work. Rmagick can be a lot of fun and you show that here in your tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Nunemaker</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-6008</link>
		<dc:creator>John Nunemaker</dc:creator>
		<pubDate>Fri, 11 Aug 2006 18:48:55 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-6008</guid>
		<description>Not off the top of my head but I&#039;m betting it&#039;s an RMagick issue. I would search RMagick and animated gif&#039;s on google and see if you can dig anything up.</description>
		<content:encoded><![CDATA[<p>Not off the top of my head but I&#8217;m betting it&#8217;s an RMagick issue. I would search RMagick and animated gif&#8217;s on google and see if you can dig anything up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruno</title>
		<link>http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/comment-page-1/#comment-6006</link>
		<dc:creator>Bruno</dc:creator>
		<pubDate>Fri, 11 Aug 2006 18:15:18 +0000</pubDate>
		<guid isPermaLink="false">http://addictedtonew.com/archives/127/rotating-images-with-rmagick-and-ruby-on-rails/#comment-6006</guid>
		<description>Hi, I&#039;ve been using file_column alongside rmagick to create thumb and medium versions of the images uploaded int my site. 

The other day I ran into a problem when I tried to upload an animated gif, in both the thumb and medium versions of the gif only the first frames are saved. 

This is the code on the model that I use to create the versions: 

file_column :image, :magick =&gt; { :versions =&gt; {&quot;tiny&quot; =&gt; &quot;75x75&quot;, &quot;medium&quot; =&gt; &quot;550x400&quot;}}

Do you happen to know how I could get around this?</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;ve been using file_column alongside rmagick to create thumb and medium versions of the images uploaded int my site. </p>
<p>The other day I ran into a problem when I tried to upload an animated gif, in both the thumb and medium versions of the gif only the first frames are saved. </p>
<p>This is the code on the model that I use to create the versions: </p>
<p>file_column :image, :magick =&gt; { :versions =&gt; {&#8220;tiny&#8221; =&gt; &#8220;75&#215;75&#8243;, &#8220;medium&#8221; =&gt; &#8220;550&#215;400&#8243;}}</p>
<p>Do you happen to know how I could get around this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

