Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't know about ALL JPEG files, but you will need to handle the <strong>two</strong> common file formats for JPEG. Since JPEG is a compression method and not a file format, the world at large has developed a few ways of storing JPEG image data in files. The two you are most likely to encounter are JFIF and EXIF. The above code covers JFIF, but doesn't handle EXIF. These two are largely incompatible but both are JPEG, so you'll need to detect and handle if you are using header information, as they defer.</p> <p>For resolution, as an example. EXIF's field are <strong>x-Resolution</strong> and <strong>y-Resolution</strong>, vs the X/Y Density approach.</p> <p>I would:</p> <ol> <li><p>Do some reading on the two formats (JFIF and EXIF). I find Wikipedia is a great place to start on this reference (for some past projects I've done), but SO most likely has some great info on this topic as well.</p> <p>JFIF: <a href="http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format" rel="noreferrer">http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format</a></p> <p>EXIF: <a href="http://en.wikipedia.org/wiki/Exif" rel="noreferrer">http://en.wikipedia.org/wiki/Exif</a></p></li> <li><p>Write code to detect the format using the starting headers</p></li> <li><p>Handle each format independently</p></li> <li><p>Wrap the whole thing so you can just toss a JPEG at it and get the density. This will also give you a great spot to toss other helper code to deals with the "fun" world of JPEG handling</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload