You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Zakharov (JIRA)" <ji...@apache.org> on 2007/10/23 14:02:52 UTC
[jira] Resolved: (HARMONY-4791) [classlib][awt][image] Harmony has
problem in drawing medium-or-large size of png file if not guarded by
MediaTracker
[ https://issues.apache.org/jira/browse/HARMONY-4791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexei Zakharov resolved HARMONY-4791.
--------------------------------------
Resolution: Fixed
Thanks Igor, there is no hangs with the new patch. I've applied it at the revision 587465. Please verify that everything is fine.
> [classlib][awt][image] Harmony has problem in drawing medium-or-large size of png file if not guarded by MediaTracker
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-4791
> URL: https://issues.apache.org/jira/browse/HARMONY-4791
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Win32
> Reporter: Chunrong Lai
> Assignee: Alexei Zakharov
> Attachments: 10million.PNG, 40million.PNG, H-4791-2.patch, H-4791-3.patch, H-4791.patch
>
>
> Sometimes I even observed that Harmony crashes in multi-threading environment but I have not reproducer yet.
> Anyway with below reproducer Harmony draw a glittering 10million.png and the 40million.png breaks finally.
> import java.io.*;
> import java.awt.*;
> import java.awt.image.*;
> import javax.swing.*;
> public class DrawImageTest extends JFrame {
> public Image image;
> public static void main(String[] args){
> DrawImageTest aTest = new DrawImageTest();
> if(args.length <1) {
> System.out.println("Please input a valid image name");
> System.exit(0);
> }
> aTest.setSize(800, 600);
> aTest.readImage(args[0]);
> aTest.show();
> }
> public DrawImageTest(){}
> public void readImage(String imageName){
> if(image == null) {
> image = Toolkit.getDefaultToolkit().getImage(imageName);
> /*******
> MediaTracker imageTracker = new MediaTracker(new JPanel());
> imageTracker.addImage(image, 0);
> try{
> imageTracker.waitForID(0);
> }catch(InterruptedException e){}
> ********/
> if(image == null) System.out.println("we get an image of null");
> else System.out.println("we get an image of width " + image.getWidth(this) + " height " + image.getHeight(this));
> }
> }
> public void paint(Graphics g){
> super.paint(g);
> g.drawImage(image, 0, 0, null);
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.