<?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: Using Paperclip and jpegcam to get pictures from your webcam into Rails</title>
	<atom:link href="http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/</link>
	<description>Ruby on Rails, programming, and SEO</description>
	<lastBuildDate>Sat, 04 Feb 2012 20:56:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: lassebunk</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-10666</link>
		<dc:creator>lassebunk</dc:creator>
		<pubDate>Fri, 18 Feb 2011 23:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-10666</guid>
		<description>I have rewritten this post for Rails 3:
http://lassebunk.dk/2011/02/19/paperclip-jpegcam-webcam-rails3/

@makaroni4: Please try the new version – it is using the latest version of Rails and latest version of jpegcam.</description>
		<content:encoded><![CDATA[<p>I have rewritten this post for Rails 3:<br />
<a href="http://lassebunk.dk/2011/02/19/paperclip-jpegcam-webcam-rails3/" rel="nofollow">http://lassebunk.dk/2011/02/19/paperclip-jpegcam-webcam-rails3/</a></p>
<p>@makaroni4: Please try the new version – it is using the latest version of Rails and latest version of jpegcam.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Updated for Rails 3: Using Paperclip and jpegcam to get pictures from your webcam into Rails – Lasse Bunk&#039;s weblog</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-10664</link>
		<dc:creator>Updated for Rails 3: Using Paperclip and jpegcam to get pictures from your webcam into Rails – Lasse Bunk&#039;s weblog</dc:creator>
		<pubDate>Fri, 18 Feb 2011 23:29:19 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-10664</guid>
		<description>[...] Here&#8217;s how to get pictures from your webcam into Rails using the Paperclip plugin and jpegcam. It is an update of my previous post: Using Paperclip and jpegcam to get pictures from your webcam into Rails. [...]</description>
		<content:encoded><![CDATA[<p>[...] Here&#8217;s how to get pictures from your webcam into Rails using the Paperclip plugin and jpegcam. It is an update of my previous post: Using Paperclip and jpegcam to get pictures from your webcam into Rails. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: makaroni4</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-9379</link>
		<dc:creator>makaroni4</dc:creator>
		<pubDate>Thu, 03 Feb 2011 21:44:15 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-9379</guid>
		<description>I`ve tried php version and it works great (I found file test.php in jpegcam archive). I`ve tried older version of jpegcam and it still doesn`t work with rails. 

What version of rails do you use? Mine is 2.3.5, may be this is a problem?</description>
		<content:encoded><![CDATA[<p>I`ve tried php version and it works great (I found file test.php in jpegcam archive). I`ve tried older version of jpegcam and it still doesn`t work with rails. </p>
<p>What version of rails do you use? Mine is 2.3.5, may be this is a problem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lassebunk</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-9327</link>
		<dc:creator>lassebunk</dc:creator>
		<pubDate>Wed, 02 Feb 2011 23:40:37 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-9327</guid>
		<description>Sounds like something&#039;s wrong with jpegcam then... Maybe you could try your version of jpegcam with another backend solution?</description>
		<content:encoded><![CDATA[<p>Sounds like something&#8217;s wrong with jpegcam then&#8230; Maybe you could try your version of jpegcam with another backend solution?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: makaroni4</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-9169</link>
		<dc:creator>makaroni4</dc:creator>
		<pubDate>Mon, 31 Jan 2011 23:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-9169</guid>
		<description>I opened uploaded image in SciTE and compared it to several others *.jpeg files - it starts and ends with same chars and it seems like the uploaded file is *.jpeg but it is broken and it is impossible to view it.</description>
		<content:encoded><![CDATA[<p>I opened uploaded image in SciTE and compared it to several others *.jpeg files &#8211; it starts and ends with same chars and it seems like the uploaded file is *.jpeg but it is broken and it is impossible to view it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lassebunk</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-9164</link>
		<dc:creator>lassebunk</dc:creator>
		<pubDate>Mon, 31 Jan 2011 21:19:46 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-9164</guid>
		<description>@makaroni4: Maybe you could try opening the file in a text editor to see which format it is?</description>
		<content:encoded><![CDATA[<p>@makaroni4: Maybe you could try opening the file in a text editor to see which format it is?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: makaroni4</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-9141</link>
		<dc:creator>makaroni4</dc:creator>
		<pubDate>Mon, 31 Jan 2011 13:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-9141</guid>
		<description>Ooops)) Seems like I copied Ruby code

*webcam.set_api_url(&#039;/photos/new/upload&#039;);</description>
		<content:encoded><![CDATA[<p>Ooops)) Seems like I copied Ruby code</p>
<p>*webcam.set_api_url(&#8216;/photos/new/upload&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: makaroni4</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-9140</link>
		<dc:creator>makaroni4</dc:creator>
		<pubDate>Mon, 31 Jan 2011 13:40:02 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-9140</guid>
		<description>Hello there) 

Could you please help me with a little problem? The thing is, that I can`t open the uploaded image. Btw I`m using Ruby 2.3.5 

The code in the view is 



webcam.set_swf_url(&#039;/webcam.swf&#039;);
webcam.set_api_url(&#039;&#039;);
webcam.set_quality(90);
webcam.set_shutter_sound(true, &#039;/shutter.mp3&#039;);
document.getElementById(&#039;webcam&#039;).innerHTML = webcam.get_html(320, 240);
 

and in the controller I wrote:

def upload
File.open(upload_path, &#039;w&#039;) do &#124;f&#124;
#f.write request.headers
#f.write Net::HTTP.get_response(URI.parse(&quot;php://input&quot;)).body
f.write request.raw_post
end
render :text =&gt; &quot;ok&quot;
end

private
 
def upload_path # is used in upload and create
file_name = session[:session_id].to_s + &#039;.jpg&#039;
File.join(RAILS_ROOT, &#039;public&#039;, &#039;uploads&#039;, file_name)
end


After I execute webcam.snap(); function the image appears in the &quot;uploads&quot; folder and its size is 25Kb (seems like photo) but it couldn`t be opened in any photo viewer, browser and so on.

I tried very hard to fix it, but it seems like only you can help me))</description>
		<content:encoded><![CDATA[<p>Hello there) </p>
<p>Could you please help me with a little problem? The thing is, that I can`t open the uploaded image. Btw I`m using Ruby 2.3.5 </p>
<p>The code in the view is </p>
<p>webcam.set_swf_url(&#8216;/webcam.swf&#8217;);<br />
webcam.set_api_url(&#8221;);<br />
webcam.set_quality(90);<br />
webcam.set_shutter_sound(true, &#8216;/shutter.mp3&#8242;);<br />
document.getElementById(&#8216;webcam&#8217;).innerHTML = webcam.get_html(320, 240);</p>
<p>and in the controller I wrote:</p>
<p>def upload<br />
File.open(upload_path, &#8216;w&#8217;) do |f|<br />
#f.write request.headers<br />
#f.write Net::HTTP.get_response(URI.parse(&#8220;php://input&#8221;)).body<br />
f.write request.raw_post<br />
end<br />
render :text =&gt; &#8220;ok&#8221;<br />
end</p>
<p>private</p>
<p>def upload_path # is used in upload and create<br />
file_name = session[:session_id].to_s + &#8216;.jpg&#8217;<br />
File.join(RAILS_ROOT, &#8216;public&#8217;, &#8216;uploads&#8217;, file_name)<br />
end</p>
<p>After I execute webcam.snap(); function the image appears in the &#8220;uploads&#8221; folder and its size is 25Kb (seems like photo) but it couldn`t be opened in any photo viewer, browser and so on.</p>
<p>I tried very hard to fix it, but it seems like only you can help me))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fernando</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-7644</link>
		<dc:creator>Fernando</dc:creator>
		<pubDate>Mon, 27 Dec 2010 19:03:58 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-7644</guid>
		<description>Hi There,

  What if the computer doesn&#039;t have a webcam? How can I detect it, because I&#039;d like to hide all things related to taking pictures ...</description>
		<content:encoded><![CDATA[<p>Hi There,</p>
<p>  What if the computer doesn&#8217;t have a webcam? How can I detect it, because I&#8217;d like to hide all things related to taking pictures &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry</title>
		<link>http://lassebunk.dk/2010/02/18/paperclip-jpegcam-webcam-rails/#comment-3176</link>
		<dc:creator>Jerry</dc:creator>
		<pubDate>Sun, 10 Oct 2010 03:26:28 +0000</pubDate>
		<guid isPermaLink="false">http://lassebunk.dk/?p=1096#comment-3176</guid>
		<description>Thanks for the response Blake. I haven&#039;t gotten the chance to try this yet. I&#039;m currently working on a different part of the project. I&#039;ll post back when I try it out. Thanks again.</description>
		<content:encoded><![CDATA[<p>Thanks for the response Blake. I haven&#8217;t gotten the chance to try this yet. I&#8217;m currently working on a different part of the project. I&#8217;ll post back when I try it out. Thanks again.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

