From 4882320f29052d50036c10dea991d69d9c575978 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 27 Feb 2011 00:33:34 -0500 Subject: [PATCH] Integrate fix advised by Heng Sin to solve a problem rendering images from AD_Client.Logo_ID on jasper reports --- org.adempiere.base/src/org/compiere/model/MImage.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MImage.java b/org.adempiere.base/src/org/compiere/model/MImage.java index 991549c512..56970a2d8c 100644 --- a/org.adempiere.base/src/org/compiere/model/MImage.java +++ b/org.adempiere.base/src/org/compiere/model/MImage.java @@ -16,7 +16,9 @@ *****************************************************************************/ package org.compiere.model; +import java.awt.Container; import java.awt.Image; +import java.awt.MediaTracker; import java.awt.Toolkit; import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -116,7 +118,10 @@ public class MImage extends X_AD_Image { Toolkit tk = Toolkit.getDefaultToolkit(); m_image = tk.createImage(data); - return m_image; + MediaTracker mediaTracker = new MediaTracker(new Container()); + mediaTracker.addImage(m_image, 0); + mediaTracker.waitForID(0); + return m_image; } catch (Exception e) { @@ -132,6 +137,9 @@ public class MImage extends X_AD_Image { Toolkit tk = Toolkit.getDefaultToolkit(); m_image = tk.getImage(url); + MediaTracker mediaTracker = new MediaTracker(new Container()); + mediaTracker.addImage(m_image, 0); + mediaTracker.waitForID(0); return m_image; } catch (Exception e)