private Photo _photo = null;
private BufferedImage _thumbnail = null;
private boolean _loadingImage = false;
+ private boolean _loadFailed = false;
/** String to show before photo is loaded */
private static final String LOADING_STRING = I18nManager.getText("details.photo.loading") + " ...";
if (_photo != inPhoto) {
_photo = inPhoto;
_thumbnail = null;
+ _loadFailed = false;
}
repaint();
}
*/
public void refresh() {
_thumbnail = null;
+ _loadFailed = false;
}
/**
if (_photo != null)
{
// read thumbnail in separate thread
- if (_thumbnail == null && !_loadingImage)
+ if (_thumbnail == null && !_loadingImage && !_loadFailed)
{
_loadingImage = true;
new Thread(this).start();
inG.setColor(Color.BLACK);
inG.drawString(LOADING_STRING, 10, 30);
}
- else
+ else if (_thumbnail != null && !_loadFailed)
{
// Copy scaled, smoothed (and rotated) image into scaled
int usableWidth = getParent().getWidth()-10;
_thumbnail = ImageUtils.createScaledImage(image, thumbSize.width, thumbSize.height);
image = null;
}
+ else _loadFailed = true;
}
_loadingImage = false;
repaint();