<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://code.msdn.microsoft.com/rss.xsl"?><rss version="2.0"><channel><title>Reading JPEG dimensions on the cheap</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Project/ProjectRss.aspx</link><description>The common and easy way of reading the dimensions of a JPEG file is to new-up an Image object and then read its Height and Width properties. While this is easy and does work, it&amp;#39;s expensive. It rea...</description><item><title>EDITED ISSUE: Fixed two bugs where certain image types would not be read</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/WorkItem/View.aspx?WorkItemId=1</link><description>Fixed two bugs that prevented the dimensions from being properly read from certain JPEG images. Also cleaned up the endian swapper.&lt;br /&gt;</description><author>mroach</author><pubDate>Mon, 08 Dec 2008 16:20:41 GMT</pubDate><guid isPermaLink="false">EDITED ISSUE: Fixed two bugs where certain image types would not be read 20081208P</guid></item><item><title>EDITED ISSUE: Fixed two bugs where certain image types would not be read</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/WorkItem/View.aspx?WorkItemId=1</link><description>Fixed two bugs that prevented the dimensions from being properly read from certain JPEG images. Also cleaned up the endian swapper.&lt;br /&gt;</description><author>mroach</author><pubDate>Mon, 08 Dec 2008 16:20:29 GMT</pubDate><guid isPermaLink="false">EDITED ISSUE: Fixed two bugs where certain image types would not be read 20081208P</guid></item><item><title>CREATED ISSUE: Fixed two bugs where certain image types would not be read</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/WorkItem/View.aspx?WorkItemId=1</link><description>Title&lt;br /&gt;</description><author>mroach</author><pubDate>Sat, 06 Dec 2008 03:43:40 GMT</pubDate><guid isPermaLink="false">CREATED ISSUE: Fixed two bugs where certain image types would not be read 20081206A</guid></item><item><title>UPDATED RELEASE: v1.2 (Dec 05, 2008)</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Release/ProjectReleases.aspx?ReleaseId=1897</link><description></description><author></author><pubDate>Sat, 06 Dec 2008 03:42:48 GMT</pubDate><guid isPermaLink="false">UPDATED RELEASE: v1.2 (Dec 05, 2008) 20081206A</guid></item><item><title>UPDATED RELEASE: v1.1 (Dec 05, 2008)</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Release/ProjectReleases.aspx?ReleaseId=1897</link><description></description><author></author><pubDate>Sat, 06 Dec 2008 03:14:15 GMT</pubDate><guid isPermaLink="false">UPDATED RELEASE: v1.1 (Dec 05, 2008) 20081206A</guid></item><item><title>UPDATED RELEASE: v1.0 (Dec 05, 2008)</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Release/ProjectReleases.aspx?ReleaseId=1897</link><description></description><author></author><pubDate>Sat, 06 Dec 2008 03:14:09 GMT</pubDate><guid isPermaLink="false">UPDATED RELEASE: v1.0 (Dec 05, 2008) 20081206A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Wiki/View.aspx?title=Home&amp;version=6</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Resource Page Description&lt;/b&gt;&lt;br /&gt;The common and easy way of reading the dimensions of a JPEG file is to new-up an Image object and then read its Height and Width properties. While this is easy and does work, it&amp;#39;s expensive. It reads the entire image into memory just to get two small pieces of information that are stored in file. This function will get the JPEG image&amp;#39;s dimensions by reading in the first few bytes of the file where the dimensions are stored. It&amp;#39;s much faster and cheaper than newing-up and Image object.&lt;br /&gt;&lt;br /&gt;I adapted some Java and Perl examples I found to work in C&amp;#35;. The only non-straight-forward thing here is reading bytes in big endian.
&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Usage Example&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Size z = ImageHelpers.JpegHelper.GetJpegImageSize(@&amp;quot;D:\BMW_M3_E90.jpg&amp;quot;);
Console.WriteLine(&amp;quot;{0}x{1}&amp;quot;, z.Width, z.Height);
&lt;/pre&gt; &lt;br /&gt;&lt;span class="codeInline"&gt;400x320&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;Nice an easy.&lt;br /&gt;
&lt;/div&gt;</description><author>mroach</author><pubDate>Fri, 05 Dec 2008 17:04:32 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20081205P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Wiki/View.aspx?title=Home&amp;version=5</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Resource Page Description&lt;/b&gt;&lt;br /&gt;The common and easy way of reading the dimensions of a JPEG file is to new-up an Image object and then read its Height and Width properties. While this is easy and does work, it&amp;#39;s expensive. It reads the entire image into memory just to get two small pieces of information that are stored in file. This function will get the JPEG image&amp;#39;s dimensions by reading in the first few bytes of the file where the dimensions are stored. It&amp;#39;s much faster and cheaper than newing-up and Image object.&lt;br /&gt;&lt;br /&gt;I adapted some Java and Perl examples I found to work in C&amp;#35;. The only non-straight-forward thing here is reading bytes in big endian.
&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Usage Example&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;
Size z = ImageHelpers.JpegHelper.GetJpegImageSize(@&amp;quot;D:\BMW_M3_E90.jpg&amp;quot;);
Console.WriteLine(&amp;quot;{0}x{1}&amp;quot;, z.Width, z.Height);
&lt;/pre&gt; &lt;br /&gt;&lt;span class="codeInline"&gt;400x320&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;Nice an easy.&lt;br /&gt;
&lt;/div&gt;</description><author>mroach</author><pubDate>Fri, 05 Dec 2008 17:04:18 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20081205P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Wiki/View.aspx?title=Home&amp;version=4</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Resource Page Description&lt;/b&gt;&lt;br /&gt;The common and easy way of reading the dimensions of a JPEG file is to new-up an Image object and then read its Height and Width properties. While this is easy and does work, it&amp;#39;s expensive. It reads the entire image into memory just to get two small pieces of information that are stored in file. This function will get the JPEG image&amp;#39;s dimensions by reading in the first few bytes of the file where the dimensions are stored. It&amp;#39;s much faster and cheaper than newing-up and Image object.&lt;br /&gt;&lt;br /&gt;I adapted some Java and Perl examples I found to work in C&amp;#35;. The only non-straight-forward thing here is reading bytes in big endian.
&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Usage Example&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;
Size z = ImageHelpers.JpegHelper.GetJpegImageSize(@&amp;quot;D:\BMW_M3_E90.jpg&amp;quot;);
Console.WriteLine(&amp;quot;{0}x{1}&amp;quot;, z.Width, z.Height);
&lt;/pre&gt; &lt;br /&gt;&lt;span class="codeInline"&gt;&amp;gt;&amp;gt; 400x320&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;Nice an easy.&lt;br /&gt;
&lt;/div&gt;</description><author>mroach</author><pubDate>Fri, 05 Dec 2008 17:04:00 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20081205P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Wiki/View.aspx?title=Home&amp;version=3</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Resource Page Description&lt;/b&gt;&lt;br /&gt;The common and easy way of reading the dimensions of a JPEG file is to new-up an Image object and then read its Height and Width properties. While this is easy and does work, it&amp;#39;s expensive. It reads the entire image into memory just to get two small pieces of information that are stored in file. This function will get the JPEG image&amp;#39;s dimensions by reading in the first few bytes of the file where the dimensions are stored. It&amp;#39;s much faster and cheaper than newing-up and Image object.&lt;br /&gt;&lt;br /&gt;I adapted some Java and Perl examples I found to work in C&amp;#35;. The only non-straight-forward thing here is reading bytes in big endian.
&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Usage Example&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Size z = ImageHelpers.JpegHelper.GetJpegImageSize(@&amp;quot;D:\bmw m3 e92 sjop arctic.jpg&amp;quot;);
Console.WriteLine(&amp;quot;{0}x{1}&amp;quot;, z.Width, z.Height);
&lt;/pre&gt; &lt;br /&gt;Nice an easy.&lt;br /&gt;
&lt;/div&gt;</description><author>mroach</author><pubDate>Fri, 05 Dec 2008 17:03:19 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20081205P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Wiki/View.aspx?title=Home&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Resource Page Description&lt;/b&gt;&lt;br /&gt;The common and easy way of reading the dimensions of a JPEG file is to new-up an Image object and then read its Height and Width properties. While this is easy and does work, it&amp;#39;s expensive. It reads the entire image into memory just to get two small pieces of information that are stored in file. This function will get the JPEG image&amp;#39;s dimensions by reading in the first few bytes of the file where the dimensions are stored. It&amp;#39;s much faster and cheaper than newing-up and Image object.&lt;br /&gt;&lt;br /&gt;I adapted some Java and Perl examples I found to work in C&amp;#35;. The only non-straight-forward thing here is reading bytes in big endian.
&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Usage Example&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;
Size z = ImageHelpers.JpegHelper.GetJpegImageSize(@&amp;quot;D:\bmw m3 e92 sjop arctic.jpg&amp;quot;);
Console.WriteLine(&amp;quot;{0}x{1}&amp;quot;, z.Width, z.Height);
&lt;/pre&gt; &lt;br /&gt;Nice an easy.&lt;br /&gt;
&lt;/div&gt;</description><author>mroach</author><pubDate>Fri, 05 Dec 2008 17:03:08 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20081205P</guid></item><item><title>UPDATED RELEASE: v1.0 (Dec 05, 2008)</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Release/ProjectReleases.aspx?ReleaseId=1897</link><description></description><author></author><pubDate>Fri, 05 Dec 2008 17:00:36 GMT</pubDate><guid isPermaLink="false">UPDATED RELEASE: v1.0 (Dec 05, 2008) 20081205P</guid></item><item><title>CREATED RELEASE: v1.0 (Dec 05, 2008)</title><link>http://code.msdn.microsoft.com/ReadingJPEGSize/Release/ProjectReleases.aspx?ReleaseId=1897</link><description></description><author></author><pubDate>Fri, 05 Dec 2008 16:48:38 GMT</pubDate><guid isPermaLink="false">CREATED RELEASE: v1.0 (Dec 05, 2008) 20081205P</guid></item></channel></rss>