Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-27 Thread Jayathirth D V
Hi Brian, Thanks for your inputs. I have updated the new bug https://bugs.openjdk.java.net/browse/JDK-8160327 with same comment. Thanks, Jay From: Brian Burkhalter Sent: Tuesday, June 28, 2016 12:41 AM To: Philip Race Cc: Jayathirth D V; 2d-dev@openjdk.java.net Subject: Re:

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-25 Thread Philip Race
Hi, So my conclusion is as follows : - in both these images, there is a thumbnail but it is inside the APP1 marker and we never even see it. So the synopsis reference to "for JPEG with embedded thumbnail" is completely misleading .. wrong even. We should just delete that part from the synopsis

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-21 Thread Phil Race
No issues with the exceptions as such. Whilst this does make things better I still have some reservations about the result of the fix since remember the bug says "JPEG with embedded thumbnail". If I apply your patch and use the original file I get two images but neither reports any thumbnails

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-21 Thread Jayathirth D V
Hi Phil, Gentle reminder for review. Thanks, Jay -Original Message- From: Jim Graham Sent: Wednesday, June 15, 2016 10:01 AM To: Jayathirth D V; Phil Race Cc: 2d-dev@openjdk.java.net Subject: Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-20 Thread Jayathirth D V
Hi Phil, Gentle remainder for review. Thanks, Jay -Original Message- From: Jim Graham Sent: Wednesday, June 15, 2016 10:01 AM To: Jayathirth D V; Phil Race Cc: 2d-dev@openjdk.java.net Subject: Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-14 Thread Jim Graham
Hi Jay, Thanks for explaining all of the details. It seems that constantly being in scan mode simplifies things because we have to be in scan mode for entropy data anyway, but it still allows errant bytes outside of the entropy data to be accepted by this parser. I'm not sure if that is a

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-13 Thread Jim Graham
Hi Jay, You still don't check the read() calls in the length case to see if you reached EOF (-1). The potential for an infinite loop is still there. Also, you still search for an FF, even if you require the function to start at an SOI marker - all subsequent markers are still subject to a

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-13 Thread Jayathirth D V
Hi Jim, Thanks for your valuable inputs. I have updated the code with your inputs: 1) We should check for complete SOI marker and not just "FF" at start of skipImage(). 2) There is no need of iis.read() which was happening in default case. iis.read() present in for loop check

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-10 Thread Jim Graham
Thanks for the response Jay, I think I was misreading some of the code as now that I look back at it, it's mostly written as I was suggesting with respect to skipping over data sections, however it is still doing some scanning to find the initial 0xFF. Some thoughts: - If we can be sure that

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-10 Thread Jayathirth D V
Hi Jim, I think the harmless byte that you are referring to will be applied only for image data(Between SOS(Start of Scan) marker and EOI). For example, any "FF" data present in Jpeg image will be represented as "FF 00". But I think application headers or comments section can contain data

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-09 Thread Jim Graham
It looks like JPEG files have protection for scanning for an FF and assuming it is a marker by making sure that all FF bytes that appear in data are followed by a harmless byte, so a brute force search is probably fine. But it still seems wasteful when we know we are at a tag and we know the

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-02 Thread Jayathirth D V
Fixed typo. From: Jayathirth D V Sent: Thursday, June 02, 2016 5:08 PM To: Philip Race Cc: Jim Graham; 2d-dev@openjdk.java.net Subject: RE: Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail Hi Phil, We have two kind of

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-02 Thread Jayathirth D V
Hi Phil, We have to kind of images with which we are able to reproduce the issue: 1) sample.jpg present in JBS bug(We can't use this image because it is licensed ). 2) JpegEmbedThumbnail.jpg taken using Prasanta's camera and used in webrev. sample.jpg : If we do

Re: [OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-01 Thread Phil Race
I am bit doubtful about this. Are you sure we are correct in reporting two images to begin with ? Thumbnails should not get counted .. -phil. On 06/01/2016 01:06 AM, Jayathirth D V wrote: Updated bug title in JBS as it was misleading. *From:* Jayathirth D V *Sent:* Wednesday, June 01, 2016

[OpenJDK 2D-Dev] Review Request for JDK-8152672 : Exception while getting second image properties for JPEG with embedded thumbnail

2016-06-01 Thread Jayathirth D V
Updated bug title in JBS as it was misleading. From: Jayathirth D V Sent: Wednesday, June 01, 2016 12:48 PM To: Philip Race; Jim Graham Cc: 2d-dev@openjdk.java.net Subject: Review Request for JDK-8152672 : Exception getting thumbnail size for JPEG with embedded thumbnail Hi, Please