⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 faq-doc-22.html

📁 JPEG教程,包括视频图象的压缩与解压缩,以及其他视频处理算法.
💻 HTML
字号:
<HEAD>
<TITLE>JPEG image compression FAQ, part 1/2 - [22] How can my program extract image dimensions from a JPEG file?</TITLE>
</HEAD>
<BODY>
Parent document is top of "<A NAME=up HREF="faq.html" tppabs="http://www.cis.ohio-state.edu/hypertext/faq/usenet/jpeg-faq/part1/faq.html"><I>JPEG image compression FAQ, part 1/2</I></A>"<BR>
Previous document is "<A NAME=up HREF="faq-doc-21.html" tppabs="http://www.cis.ohio-state.edu/hypertext/faq/usenet/jpeg-faq/part1/faq-doc-21.html"><I>[21] What if I need more than 8-bit precision?</I></A>"<BR>
Next document is "<A NAME=up HREF="faq-doc-23.html" tppabs="http://www.cis.ohio-state.edu/hypertext/faq/usenet/jpeg-faq/part1/faq-doc-23.html"><I>[23] Where can I learn about using images on the World Wide Web?</I></A>"<BR>
<HR>
<H1>[22] How can my program extract image dimensions from a JPEG file?</H1>
<PRE>
The header of a JPEG file consists of a series of blocks, called "markers".
The image height and width are stored in a marker of type SOFn (Start Of
Frame, type N).  To find the SOFn you must skip over the preceding markers;
you don't have to know what's in the other types of markers, just use their
length words to skip over them.  The minimum logic needed is perhaps a page
of C code.  (Some people have recommended just searching for the byte pair
representing SOFn, without paying attention to the marker block structure.
This is unsafe because a prior marker might contain the SOFn pattern, either
by chance or because it contains a JPEG-compressed thumbnail image.  If you
don't follow the marker structure you will retrieve the thumbnail's size
instead of the main image size.)  A profusely commented example in C can be
found in rdjpgcom.c in the IJG distribution (see part 2, item 15).  Perl
code can be found in wwwis, from <A NAME=id13 HREF="tppmsgs/msgs0.htm#83" tppabs="http://www.tardis.ed.ac.uk/%7eark/wwwis/">http://www.tardis.ed.ac.uk/~ark/wwwis/</A>.
</PRE>
<HR>
Parent document is top of "<A NAME=up HREF="faq.html" tppabs="http://www.cis.ohio-state.edu/hypertext/faq/usenet/jpeg-faq/part1/faq.html"><I>JPEG image compression FAQ, part 1/2</I></A>"<BR>
Previous document is "<A NAME=up HREF="faq-doc-21.html" tppabs="http://www.cis.ohio-state.edu/hypertext/faq/usenet/jpeg-faq/part1/faq-doc-21.html"><I>[21] What if I need more than 8-bit precision?</I></A>"<BR>
Next document is "<A NAME=up HREF="faq-doc-23.html" tppabs="http://www.cis.ohio-state.edu/hypertext/faq/usenet/jpeg-faq/part1/faq-doc-23.html"><I>[23] Where can I learn about using images on the World Wide Web?</I></A>"<BR>
</BODY>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -