// Filling up processor_imagefetcher_queue
}
public void saveImages() throws IOException
{
ConcurrentLinkedQueue results = thread_pool.getResult();
ImageNode image ;
if(results.isEmpty()) // If there is no image then return
return ;
int max_x=0;
int max_y=0;
BufferedImage image_iterate;
for(Iterator i=results.iterator(); i.hasNext();)
{
image = (ImageNode) i.next();
image_iterate= image.actual_image;
max_x+=image_iterate.getWidth();
if(max_y<image_iterate.getHeight())
max_y=image_iterate.getHeight();
}
BufferedImage new_image = new BufferedImage(max_x,max_y,BufferedImage.TYPE_3BYTE_BGR);
Graphics g = new_image.getGraphics();
int temp_x=0;
for(Iterator i=results.iterator(); i.hasNext();)
{
image = (ImageNode) i.next();
image_iterate= image.actual_image;
g.drawImage(image_iterate, temp_x, 0, null);
temp_x += image_iterate.getWidth();
}
results.clear(); // Cleaning and sanitizing queue
File outputfile = new File("image_cache\\"+item.hashCode()+".png");
ImageIO.write(new_image, "png", outputfile);
}