<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Sans Serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ok why does this not happen with multi band jpgs?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Even Rouault [mailto:even.rouault@mines-paris.org] <br><b>Sent:</b> Friday, April 13, 2012 1:13 PM<br><b>To:</b> gdal-dev@lists.osgeo.org<br><b>Cc:</b> Ethan Alpert<br><b>Subject:</b> Re: [gdal-dev] Problem with garbage bytes of data after EOI marker in single band JPEG<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>Le vendredi 13 avril 2012 19:53:41, Ethan Alpert a écrit :<o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>> <o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>> This has been running for years. Recently a customer who receives these<o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>> started scanning the JPG's for security threats. Turns out that the<o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>> JPG's I've been writing have garbage data after the JPEG EOI marker.<o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>><o:p> </o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>This is not garbage, but mask data appended after the JPEG data stream, as documented in the JPEG driver doc : <o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>"""The driver also supports the "zlib compressed mask appended to the file" <o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>approach used by a few data providers to add a bitmask to identify pixels that <o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>are not valid data."""<o:p></o:p></span></p><p style='margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Sans Serif","serif"'>The mask is due to the advertized nodata value in the VRT. You can likely remove it by adding <<i>HideNoDataValue</i>>1</<i>HideNoDataValue</i>> in the VRT file under the VRTRasterBand element.<o:p></o:p></span></p></div><PRE>This electronic communication and any attachments may contain confidential and proprietary
information of DigitalGlobe, Inc. If you are not the intended recipient, or an agent or employee
responsible for delivering this communication to the intended recipient, or if you have received
this communication in error, please do not print, copy, retransmit, disseminate or
otherwise use the information. Please indicate to the sender that you have received this
communication in error, and delete the copy you received. DigitalGlobe reserves the
right to monitor any electronic communication sent or received by its employees, agents
or representatives.
</PRE></body></html>