BF [ 1674706 ] LoadError when image url gets redirect
https://sourceforge.net/tracker/index.php?func=detail&aid=1674706&group_id=176962&atid=879332
This commit is contained in:
parent
e282edfbcb
commit
fed3191700
|
@ -224,8 +224,8 @@ public class ImageElement extends PrintElement
|
||||||
if (m_image == null)
|
if (m_image == null)
|
||||||
return true;
|
return true;
|
||||||
// we have an image
|
// we have an image
|
||||||
waitForLoad(m_image);
|
// if the image was not loaded, consider that there is no image - teo_sarca [ 1674706 ]
|
||||||
if (m_image != null)
|
if (waitForLoad(m_image) && m_image != null)
|
||||||
{
|
{
|
||||||
p_width = m_image.getWidth(this);
|
p_width = m_image.getWidth(this);
|
||||||
p_height = m_image.getHeight(this);
|
p_height = m_image.getHeight(this);
|
||||||
|
@ -253,6 +253,12 @@ public class ImageElement extends PrintElement
|
||||||
p_width = (float) m_scaleFactor * p_width;
|
p_width = (float) m_scaleFactor * p_width;
|
||||||
p_height = (float) m_scaleFactor * p_height;
|
p_height = (float) m_scaleFactor * p_height;
|
||||||
}
|
}
|
||||||
|
// If the image is not loaded set it to null.
|
||||||
|
// This prevents SecurityException when invoking getWidth() or getHeight(). - teo_sarca [ 1674706 ]
|
||||||
|
else {
|
||||||
|
m_image = null;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // calculateSize
|
} // calculateSize
|
||||||
|
|
||||||
|
|
|
@ -1354,7 +1354,7 @@ public class TableElement extends PrintElement
|
||||||
else if (printItems[index] instanceof ImageElement)
|
else if (printItems[index] instanceof ImageElement)
|
||||||
{
|
{
|
||||||
Image imageToDraw = ((ImageElement)printItems[index]).getImage();
|
Image imageToDraw = ((ImageElement)printItems[index]).getImage();
|
||||||
if (imageToDraw.getHeight((ImageElement)printItems[index]) != -1)
|
if (imageToDraw != null) // teo_sarca [ 1674706 ]
|
||||||
{
|
{
|
||||||
// Draw image using the scale factor - teo_sarca, [ 1673548 ] Image is not scaled in a report table cell
|
// Draw image using the scale factor - teo_sarca, [ 1673548 ] Image is not scaled in a report table cell
|
||||||
double scale = ((ImageElement)printItems[index]).getScaleFactor();
|
double scale = ((ImageElement)printItems[index]).getScaleFactor();
|
||||||
|
|
Loading…
Reference in New Issue