<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix"><span class="changed">Rather than
        adding a comment block, it seems you need to edit the preceding
        one.<br>
      </span><br>
      <pre> * IJG assumes all unidentified 3-channels are YCbCr.
1715                  * We assume that only if the second two channels are
1716                  * subsampled (either horizontally or vertically).  If not,
1717                  * we assume RGB.

The fix is invalidating that comment but that is intended since
(a) following the comment is causing the bug
(b) the comment is contradicting the public Metadata spec

For the benefit of others, the text in the spec is :
----
If neither marker segment is present, the following procedure is followed: ....
For 3- and 4-channel images, the component ids are consulted.  If these
values are 1-3 for a 3-channel image, then the image is assumed to be YCbCr. 

... Otherwise, 3-channel subsampled images are assumed to be YCbCr, 
3-channel non-subsampled images are assumed to be RGB
---

So here is my suggested replacement text for the existing comment block :
---
In the absence of certain markers, IJG has interpreted component id's of [1,2,3] as meaning YCbCr.
We follow that interpretation, which is additionally described in the Image I/O JPEG metadata spec.
If that condition is not met here the next step here is to examine the subsampling factors
If any differ we also assume YCbCr, but if all are the same then we assume RGB
This is also described in the Image I/O JPEG metadata spec.
</pre>
      --<br>
      <br>
      -phil.<br>
      <br>
      On 11/23/2015 04:01 AM, Jayathirth D V wrote:<br>
    </div>
    <blockquote cite="mid:498e0191-cfa8-4446-8b71-fdd551490184@default"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 15 (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:"Times New Roman \,serif";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle19
        {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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Hi Prasanta,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Removed
            repeated usage of getWidth() and getHeight(). Please review.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><a
              moz-do-not-send="true"
              href="http://cr.openjdk.java.net/%7Ejdv/8041501/webrev.02/">http://cr.openjdk.java.net/~jdv/8041501/webrev.02/</a><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Jay<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
                style="color:windowtext"> prasanta sadhukhan <br>
                <b>Sent:</b> Monday, November 23, 2015 5:15 PM<br>
                <b>To:</b> Jayathirth D V<br>
                <b>Cc:</b> Philip Race; <a class="moz-txt-link-abbreviated" href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a><br>
                <b>Subject:</b> Re: <OpenJDK 2D-Dev> Review
                request for JDK - 8041501 : ImageIO reader is not
                capable of reading JPEGs without JFIF header<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin-bottom:12.0pt"><span
            style="font-size:12.0pt"><o:p> </o:p></span></p>
        <div>
          <p class="MsoNormal">On 11/23/2015 5:11 PM, Jayathirth D V
            wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:windowtext">Hi
              Prasanta,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:windowtext"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:windowtext">Thanks for
              suggestion. I have made related changes and updated the
              Webrev.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:windowtext"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:windowtext">Webrev : <a
                moz-do-not-send="true"
                href="http://cr.openjdk.java.net/%7Ejdv/8041501/webrev.01/">http://cr.openjdk.java.net/~jdv/8041501/webrev.01/</a></span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:windowtext"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:windowtext">Please
              review.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:windowtext"> </span><o:p></o:p></p>
        </blockquote>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman",serif">There's no point getting the width &
            height repeatedly . You can get it once and use that info in
            the loop. It's not going to change in runtime, isn;t it :-)<br>
            <br>
            Regards<br>
            Prasanta<br>
            <br>
            <o:p></o:p></span></p>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:windowtext">Thanks,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:windowtext">Jay</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0in 0in 0in">
              <p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
                  style="color:windowtext"> prasanta sadhukhan <br>
                  <b>Sent:</b> Monday, November 23, 2015 4:43 PM<br>
                  <b>To:</b> Jayathirth D V; <a moz-do-not-send="true"
                    href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a><br>
                  <b>Cc:</b> Philip Race<br>
                  <b>Subject:</b> Re: <OpenJDK 2D-Dev> Review
                  request for JDK - 8041501 : ImageIO reader is not
                  capable of reading JPEGs without JFIF header</span><o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal">Looks ok to me.<br>
            But probably you could check for image width &height
            programmatically instead of hardcoding to 64 in testcode.<br>
            <br>
            Regards<br>
            Prasanta<o:p></o:p></p>
          <div>
            <p class="MsoNormal">On 11/23/2015 4:09 PM, Jayathirth D V
              wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <p class="MsoNormal">Hello All,<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal"><u>Please review following fix in JDK9:</u><o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Bug : <a moz-do-not-send="true"
                href="https://bugs.openjdk.java.net/browse/JDK-8041501">https://bugs.openjdk.java.net/browse/JDK-8041501</a><o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Webrev : <a moz-do-not-send="true"
                href="http://cr.openjdk.java.net/%7Ejdv/8041501/webrev.00/">http://cr.openjdk.java.net/~jdv/8041501/webrev.00/</a><o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Issue : Pink discoloration when we read
              JPEG images without JFIF & EXIF header and having no
              subsampling.<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Root cause : We are overriding JPEG
              color space set in IJG library at imageioJPEG.c without
              checking component ID’s properly when JFIF & EXIF are
              not there. Decision to change color space is solely done
              consulting sampling factors.<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Solution : Added extra check to verify
              component ID’s also before changing color space determined
              by IJG library when there is no JFIF & EXIF header.<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Thanks,<o:p></o:p></p>
            <p class="MsoNormal">Jay<o:p></o:p></p>
          </blockquote>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:"Times New Roman
              \,serif""> </span><o:p></o:p></p>
        </blockquote>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman",serif"><o:p> </o:p></span></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>