-3

I want to browse and display big Tiff image on web using HTML and Javascript and do image processing on it using java applet.

All the image loading and processing should be on client machine. For viewing of image I want to use HTML and Javascript.

For image processing I want to use java applet.

  • This is not a question, more like a statement of what you want to create. I'm sure there are TIFF libraries for JS too, but if you really want to go the applet route, you should try to implement what you have outlined above. If you have trouble implementing that, come back and [ask for help](http://stackoverflow.com/help/how-to-ask) to solve specific problems. – Harald K Apr 07 '16 at 08:48

1 Answers1

0

i have face same prob as u face. As we all know that tiff image can't be visible on web browser. so we have to convert into Png or any other format.

File file = new File(path_of_tiff_file, name_of_tiff_file);
String newName = file.getName();
// if (!file.exists()) {
        item.write(file);
        if(item.getName().toLowerCase().indexOf(".tif") >=0 || item.getName().toLowerCase().indexOf(".tiff") >=0 ){

                            newName =item.getName().subSequence(0, item.getName().lastIndexOf(".")) + ".png";
                            File newFile = new File(path , newName);
                            BufferedImage image= null;
                            try {
                                image = Sanselan.getBufferedImage(file);
                            } catch (Exception e) {
                                // TODO: handle exception
                                e.printStackTrace();
                            }
                            Sanselan.writeImage(image, newFile, ImageFormat.IMAGE_FORMAT_PNG, new Hashtable());
                        }
Arpit
  • 1
  • 4