boolean returnRelativePath = true;
	protected String handleImage(IImage image, Object context, String prefix, boolean needMap)	{		String mapID = null;		if(needMap)		{			mapID = getImageMapID(image);			if(map.containsKey(mapID))			{				return (String)map.get(mapID);			}		}		String ret = null;		boolean returnRelativePath = true; 		if (context != null				&& (context instanceof HTMLRenderContext))		{			HTMLRenderContext myContext = (HTMLRenderContext) context;			String imageURL = myContext.getBaseImageURL();			String imageDir = myContext.getImageDirectory();			String reportName = (String)image.getRenderOption().getOutputSetting().get(RenderOptionBase.OUTPUT_FILE_NAME);			String reportBase = null;			if(reportName != null)			{				reportBase = new File(new File(reportName).getAbsolutePath()).getParent();			}			else			{				reportBase = new File(".").getAbsolutePath();			}			String imageAbsoluteDir = null;			if (imageDir == null)			{				imageAbsoluteDir = reportBase;				imageURL = null;//return file path				imageDir = "."; //$NON-NLS-1$			}			else			{				if(!FileUtil.isRelativePath(imageDir))				{					returnRelativePath = false;					imageAbsoluteDir = imageDir;				}				else				{					imageAbsoluteDir = reportBase + "/" + imageDir; //$NON-NLS-1$				}			}			String fileName; 			File file;			synchronized (HTMLCompleteImageHandler.class)			{				String extension = image.getExtension();				if(extension!=null && extension.length()>0)				{					fileName = createUniqueFileName(imageAbsoluteDir, prefix, extension); //$NON-NLS-1$				}				else				{					fileName = createUniqueFileName(imageAbsoluteDir, prefix); 				}				file = new File(imageAbsoluteDir, fileName); //$NON-NLS-1$				try				{					image.writeImage(file);				}				catch (IOException e)				{					log.log(Level.SEVERE,e.getMessage(),e);				}			}			if (imageURL != null)			{				ret = imageURL + "/" + fileName; //$NON-NLS-1$			}			else			{				if(returnRelativePath)				{					ret = imageDir + "/" + fileName; //$NON-NLS-1$				}				else				{					ret = file.getAbsolutePath(); //$NON-NLS-1$				}			}						if(needMap)			{				map.put(mapID, ret);			}		}		return ret;	}