<Swing Dev> [11][JDK-8195095]Images are not scaled correctly in JEditorPane

Krishna Addepalli krishna.addepalli at oracle.com
Wed Mar 7 16:18:44 UTC 2018


Hi Semyon,

 

To reduce the possibility of the test passing / failing due to wrong reasons, I have changed the color of the image to blue, and updated the test accordingly.

Here is the new webrev: http://cr.openjdk.java.net/~kaddepalli/8195095/webrev02

 

Thanks,

Krishna

 

From: Krishna Addepalli 
Sent: Monday, March 5, 2018 11:59 PM
To: Semyon Sadetsky <semyon.sadetsky at oracle.com>; Prasanta Sadhukhan <prasanta.sadhukhan at oracle.com>; swing-dev at openjdk.java.net
Subject: RE: <Swing Dev> [11][JDK-8195095]Images are not scaled correctly in JEditorPane

 

I tried on Ubuntu 17.10, but since the getPixelColor always returns black, the test will pass, which is why I was asking.

 

Thanks,

Krishna

 

From: Semyon Sadetsky 
Sent: Monday, March 5, 2018 11:57 PM
To: Krishna Addepalli <HYPERLINK "mailto:krishna.addepalli at oracle.com"krishna.addepalli at oracle.com>; Prasanta Sadhukhan <HYPERLINK "mailto:prasanta.sadhukhan at oracle.com"prasanta.sadhukhan at oracle.com>; HYPERLINK "mailto:swing-dev at openjdk.java.net"swing-dev at openjdk.java.net
Subject: Re: <Swing Dev> [11][JDK-8195095]Images are not scaled correctly in JEditorPane

 

On 03/05/2018 10:23 AM, Krishna Addepalli wrote:

Hi Semyon,

 

Did you try it in Windows or Linux? I have tested it on Mac, and found that it fails before the fix and passes after the fix.

I tried it on Linux. But the change is in generic code why the test result depends on the platform?

--Semyon

 

Thanks,

Krishna

 

From: Semyon Sadetsky 
Sent: Monday, March 5, 2018 10:01 PM
To: Krishna Addepalli HYPERLINK "mailto:krishna.addepalli at oracle.com"<krishna.addepalli at oracle.com>; Prasanta Sadhukhan HYPERLINK "mailto:prasanta.sadhukhan at oracle.com"<prasanta.sadhukhan at oracle.com>; HYPERLINK "mailto:swing-dev at openjdk.java.net"swing-dev at openjdk.java.net
Subject: Re: <Swing Dev> [11][JDK-8195095]Images are not scaled correctly in JEditorPane

 

Hi Krishna,

I tried your test before the fix and it passed.

--Semyon

 

On 03/03/2018 12:07 AM, Krishna Addepalli wrote:

Hi Prasanta,

 

Thanks for the quick review. I have updated the testcase with your suggestion. Here it is: HYPERLINK "http://cr.openjdk.java.net/%7Ekaddepalli/8195095/webrev01"http://cr.openjdk.java.net/~kaddepalli/8195095/webrev01

 

Krishna

 

From: Prasanta Sadhukhan 
Sent: Saturday, March 3, 2018 1:06 PM
To: Krishna Addepalli HYPERLINK "mailto:krishna.addepalli at oracle.com"<krishna.addepalli at oracle.com>; HYPERLINK "mailto:swing-dev at openjdk.java.net"swing-dev at openjdk.java.net
Subject: Re: <Swing Dev> [11][JDK-8195095]Images are not scaled correctly in JEditorPane

 

looks good to me. 

Only thing, in test, JFrame creation also needs to be in EDT.

Regards
Prasanta

On 3/3/2018 12:40 PM, Krishna Addepalli wrote:

Hi All,

 

Please review a fix for JDK-8195095: https://bugs.openjdk.java.net/browse/JDK-8195095

 

Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Ekaddepalli/8195095/webrev00"http://cr.openjdk.java.net/~kaddepalli/8195095/webrev00

 

Problem: When a text html is specified with an image, omitting either the height/width parameter, JEditorPane scales it to default value of the missing parameter, whereas it should fetch the actual value from the image.

 

Fix: The problem is in ImageView.java. In the imageUpdate function, in the resizing logic the "changed" flag is set to 1 if height is present, and to 2 if width is present. But while updating the width, the check is swapped, i.e width is set if flag is 1 and vice versa.

 

PS: The webrev contains a new "circle.png" file, so when you import the patch, you may need to manually copy the file, since "hg import" doesnot automatically import the .png files from the patch file.

 

Thanks

Krishna

 

 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20180307/26350efd/attachment.html>


More information about the swing-dev mailing list