Java ByteArray TIFF Image

We have a image server that we built for Flash 5/Generator to
load tiff images into flash and updated it to work with MX when
loading JPGs was added. We recently removed the socket server and
now have this working from JAVA via a direct call. So the image is
processes for the app server and sent down. Before we had a servlet
that handled the byte array but I would like to make the call
directly to the java via remoting...That part is working but how
can I convert that to a image in flash. With the servlet I would
just loadmovie("servlet"); so if I am calling java directly ...
what would that look like.
The reason for this is security. We have a work around by
dynamically inserting the tiff into a SWF and placing that SWF on a
web server that I can load from. If I could just call the java then
it would work without having to stick sensitive data on a web
server for anyone to call. That would work a lot like cfcontent in
coldfusion.
Thanks

Hi,
Did you read the section Document Area -> Pictures? It says how to embed pictures. It looks like TIF isn't supported. If you don't want to read the specification, then just open up an editor that supports RTF. Then create the document you want, finally save and look at the saved RTF file.
/Kaj

Similar Messages

  • Java returning incorrect values for width and height of a Tiff image

    I have some TIFF images (sorry, I cannot post them b/c of there confidential nature) that are returning the incorrect values for the width and height. I am using Image.getWidth(null) and have tried the relevant methods from BufferedImage. When I open the same files in external viewers (Irfanview, MS Office Document Imaging) they look fine and report the "correct" dimensions. When I re-save the files, my code works fine. Obviously, there is something wrong with the files, but why would the Java code fail and not the external viewers? Is there some way I can detect file problems?
    Here is the code, the relevant section is in the print() routine.
    * ImagePrinter.java
    * Created on Feb 27, 2008
    * Created by tso1207
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.print.PageFormat;
    import java.awt.print.PrinterException;
    import java.io.File;
    import java.io.IOException;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.FileImageInputStream;
    import javax.imageio.stream.ImageInputStream;
    import com.shelter.io.FileTypeIdentifier;
    public class ImagePrinter extends FilePrintable
       private final ImageReader _reader;
       private final int _pageCount;
       private final boolean _isTiff;
       //for speed we will hold current page info in memory
       private Image _image = null;
       private int _imgWidth = 0;
       private int _imgHeight = 0;
       private int _currentPage = -1;
       public ImagePrinter(File imageFile) throws IOException
          super(imageFile);
          ImageInputStream fis = new FileImageInputStream(getFile());
          Iterator readerIter = ImageIO.getImageReaders(fis);
          ImageReader reader = null;
          while (readerIter.hasNext())
             reader = (ImageReader) readerIter.next();
          reader.setInput(fis);
          _reader = reader;
          int pageCount = 1;
          String mimeType = FileTypeIdentifier.getMimeType(imageFile, true);
          if (mimeType.equalsIgnoreCase("image/tiff"))
             _isTiff = true;
             pageCount = reader.getNumImages(true);
          else
             _isTiff = false;
          _pageCount = pageCount;
       public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
          throws java.awt.print.PrinterException
          int drawX = 0, drawY = 0;
          double scaleRatio = 1;
          if (getCurrentPage() != (pageIndex - getPageOffset()))
             try
                setCurrentPage(pageIndex - getPageOffset());
                setImage(_reader.read(getCurrentPage()));
                setImgWidth(getImage().getWidth(null));
                setImgHeight(getImage().getHeight(null));
             catch (IndexOutOfBoundsException e)
                return NO_SUCH_PAGE;
             catch (IOException e)
                throw new PrinterException(e.getLocalizedMessage());
             if (!_isTiff && getImgWidth() > getImgHeight())
                pf.setOrientation(PageFormat.LANDSCAPE);
             else
                pf.setOrientation(PageFormat.PORTRAIT);
          Graphics2D g2 = (Graphics2D) g;
          g2.translate(pf.getImageableX(), pf.getImageableY());
          g2.setClip(0, 0, (int) pf.getImageableWidth(), (int) pf.getImageableHeight());
          scaleRatio =
             (double) ((getImgWidth() > getImgHeight())
                ? (pf.getImageableWidth() / getImgWidth())
                : (pf.getImageableHeight() / getImgHeight()));
          //check the scale ratio to make sure that we will not write something off the page
          if ((getImgWidth() * scaleRatio) > pf.getImageableWidth())
             scaleRatio = (pf.getImageableWidth() / getImgWidth());
          else if ((getImgHeight() * scaleRatio) > pf.getImageableHeight())
             scaleRatio = (pf.getImageableHeight() / getImgHeight());
          int drawWidth = getImgWidth();
          int drawHeight = getImgHeight();
          //center image
          if (scaleRatio < 1)
             drawX = (int) ((pf.getImageableWidth() - (getImgWidth() * scaleRatio)) / 2);
             drawY = (int) ((pf.getImageableHeight() - (getImgHeight() * scaleRatio)) / 2);
             drawWidth = (int) (getImgWidth() * scaleRatio);
             drawHeight = (int) (getImgHeight() * scaleRatio);
          else
             drawX = (int) (pf.getImageableWidth() - getImgWidth()) / 2;
             drawY = (int) (pf.getImageableHeight() - getImgHeight()) / 2;
          g2.drawImage(getImage(), drawX, drawY, drawWidth, drawHeight, null);
          g2.dispose();
          return PAGE_EXISTS;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since version XXX
        * @return
       public int getPageCount()
          return _pageCount;
       public void destroy()
          setImage(null);
          try
             _reader.reset();
             _reader.dispose();
          catch (Exception e)
          System.gc();
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public Image getImage()
          return _image;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getImgHeight()
          return _imgHeight;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getImgWidth()
          return _imgWidth;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param image
       public void setImage(Image image)
          _image = image;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setImgHeight(int i)
          _imgHeight = i;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setImgWidth(int i)
          _imgWidth = i;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getCurrentPage()
          return _currentPage;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setCurrentPage(int i)
          _currentPage = i;
    }Edited by: jloyd01 on Jul 3, 2008 8:26 AM

    Figured it out. The files have a different vertical and horizontal resolutions. In this case the horizontal resolution is 200 DPI and the vertical is 100 DPI. The imgage width and height values are based on those resolution values. I wrote a section of code to take care of the problem (at least for TIFF 6.0)
       private void setPageSize(int pageNum) throws IOException
          IIOMetadata imageMetadata = _reader.getImageMetadata(pageNum);
          //Get the IFD (Image File Directory) which is the root of all the tags
          //for this image. From here we can get all the tags in the image.
          TIFFDirectory ifd = TIFFDirectory.createFromMetadata(imageMetadata);
          double xPixles = ifd.getTIFFField(256).getAsDouble(0);
          double yPixles = ifd.getTIFFField(257).getAsDouble(0);
          double xRes = ifd.getTIFFField(282).getAsDouble(0);
          double yres = ifd.getTIFFField(283).getAsDouble(0);
          int resUnits = ifd.getTIFFField(296).getAsInt(0);
          double imageWidth = xPixles / xRes;
          double imageHeight = yPixles / yres;
          //if units are in CM convert ot inches
          if (resUnits == 3)
             imageWidth = imageWidth * 0.3937;
             imageHeight = imageHeight * 0.3937;
          //convert to pixles in 72 DPI
          imageWidth = imageWidth * 72;
          imageHeight = imageHeight * 72;
          setImgWidth((int) Math.round(imageWidth));
          setImgHeight((int) Math.round(imageHeight));
          setImgAspectRatio(imageWidth / imageHeight);
       }

  • JAI(Java Advanced Imaging) Problem with splitting TIFF images

    Hi
    I am getting problem with height when I use this program to split TIFF images
    ImageDecoder decImage = ImageCodec.createImageDecoder("tiff", inStr,
    null);
    Then it creates RenderedImage page by page and encodes them to file:
    String outFileName = "";
    OutputStream outStr;
    TIFFEncodeParam encParam = new TIFFEncodeParam();
    encParam.setCompression(TIFFEncodeParam.COMPRESSION_PACKBITS);
    for (int i=0,n=this.getPageCount(); i < n; i++)
    outImage = this.decImage.decodeAsRenderedImage(i);
    outFileName = "C:\\Temp\\Split" + i + ".tif";
    outStr = new FileOutputStream(outFileName);
    BufferedOutputStream bOutStr = new BufferedOutputStream(outStr);
    encImage = ImageCodec.createImageEncoder("tiff",bOutStr,encParam);
    encImage.encode(outImage);
    bOutStr.flush();
    bOutStr.close();
    }The images are shrinking when I split . I need a solution to this problem.
    Thanks for any help in advance
    Sudheer.

    Hi
    Did you get a solution for your problem. I am also trying to split a TIFF file.
    Thanks in advance
    Antony

  • How to add a text Component ( text annotation) to the Tiff Image

    Hi.............
    This is the first time I am using Sun Developers Forum.......................
    My problem is.............I want to add a component ( Text or Label ) to the Tiff Image which is displayed on the JIMICanavs [ from JIMI API ].
    Even , if anybody knows about How to add a component to the JIMICanavs , Please help me..................................

    I'm curious: is JIMI still popular? What advantange does it have over the current Java 2D support in the J2SE, or over JAI?

  • How can I merge two TIFF images in one...?

    I need some help please, I am looking for a way to "resize" black & white single TIFF images.
    The process I need to do is like cutting a small image and paste it over a new blank letter-size image (at 300 dpi), like a template.
    Or better yet, is there a way to do something like this...?
    Open image...
    image.*width* = 2550;
    image.*height* = 3300;
    image.save();Some APIs and topics in the internet do or talk about resizing, but the final images get stretched or shrinked and I need them not to do so at all.
    Also, I do not need to display the images, only to get the TIFF images processed and saved back to a file.
    How can I do this with Java and JAI? Unfortunately I am almost new to this and I don't know how difficult it might be to deal with images.

    If 2550 x 3300 isn't the original aspect ratio of the image, then the image is going to looked streched or shrinked in at least one dimension. There is no way around that. It would be like resizing a 2 pixel by 2 pixel image into a 3 pixel by 6 pixel image. The image would look like it's height shrunk or it's width stretched. Had I resized it to 3 pixels by 3 pixels or 6 pixels by 6 pixels, though, then it wouldn't look shrunken or streched.
    Open image...
    image.*width* = 2550;
    image.*height* = 3300;
    image.save();*1)* To open a TIFF image you can use the javax.swing.ImageIO class. It has these static methods
    read(File input)
    read(ImageInputStream stream)
    read(InputStream input)
    read(URL input) You can use which ever method you want. But first you need to install [JAI-ImageIO|https://jai-imageio.dev.java.net/binary-builds.html]. The default ImageReaders that plug themselves into the ImageIO package are BMP, PNG, GIF, and JPEG. JAI-ImageIO will add TIFF, and a few other formats.
    The downside is that if clients want to you use your program on their machine then they to will need to install JAI-ImageIO to read the tiffs. To get around this, you can go to your Java/jdk1.x.x_xx/jre/lib/ext/ folder and copy the jai_imageio.jar file (after you've installed JAI-ImageIO). You can also obtain this jar from any one of the zip files of the [daily builds|https://jai-imageio.dev.java.net/binary-builds.html#Daily_builds]. If you add this jar to your program's classpath and package it together with your program, then clients won't need to install JAI-ImageIO and you'll still be able to read TIFF's. The downside of simply adding the jar to the classpath is that you won't be able to take advantage of a natively accelerated JPEG reader that comes with installing JAI-ImageIO (instead, ImageIO will use the default one).
    *2)* Once you've installed [JAI-ImageIO|https://jai-imageio.dev.java.net/binary-builds.html] and used ImageIO.read(...), you'll have a BufferedImage. To resize it you can do the following
    BufferedImage newImage = new BufferedImage(2550,3300,BufferedImage.TYPE_BYTE_BINARY);
    Graphics2D g = newImage.createGraphics();
    g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    g.drawImage(oldImage,0,0,2550,3300,null);
    g.dispose();Here, I simply drew the old image (the one returned by ImageIO.read(...)) onto a new BufferedImage object of the appropriate size. Because you said they were black and white TIFF's, I used BufferedImage.TYPE_BYTE_BINARY, which is a black and white image. If you decide to use one the BufferedImage types that support color, then a 2550x3330 image would require at least 25 megabytes to hold into memory. On the other hand, a binary image of that size will only take up about one meg.
    I specified on the graphics object that I wanted Bilinear Interpolation when scaling. The default is Nearest Neighbor interpolation, which while fast, dosen't look very good. Bilinear offers pretty good results scaling both up or down at fast speeds. Bicubic interpolation is the next step up. If you find the resized image to be subpar, then come back and post. There are a couple of other ways to resize an image.
    Note, however, if 2550 x 3300 is not the same aspect ratio as the the TIFF image you loaded, then the resized image will look shrunk or stretched along one dimension. There is absolutely no way around this no matter what resizing technique you use. You'll need an image whose original dimensions are in a 2550/3300 = .772 ratio if you want the resized image to not look like it's streched (you can crop the opened image if you want).
    *3)* Now we save the "newImage" with the same class we read images with: ImageIO . It has these static methods
    write(RenderedImage im, String formatName, File output)
    write(RenderedImage im, String formatName, ImageOutputStream output)
    write(RenderedImage im, String formatName, OutputStream output)You'll suply the resized BufferedImage as the first parameter, "tiff" as the second parameter and an appropriate output for the third parameter. It's pretty much a one line statement to read or write an image. All in all, the whole thing is about 7 lines of code. Not bad of all.
    Now as for the 300 dpi thing, there is a way to set the dpi in the Image's metadata. I'm pretty good at reading an image's metadata, but I've never really tried writing out my own metadata. I know you can set the dpi, and I have a somewhat vague idea how it might be done, but it's not something I've tried before. I think I'll look more into it.

  • How to retain the same resolution while croping a tiff image using jai api

    Hi all,
    I have designed a program to crop a tiff image.But after croping the tiff,the resultant file resolution is not the same as the original source file.
    In the program,the source file Nadeshiko_v1_02.tif has the resolution(X) of 1200 DPI and resolution(Y) has 1200 DPI pixels.
    But after croping the resolution of output file is 100 DPI.
    Please give me some idea on how to retain the same resolution.
    <code>
    package jai;
    import java.awt.Frame;
    import java.awt.image.RenderedImage;
    import java.awt.image.renderable.ParameterBlock;
    import java.awt.image.renderable.RenderableImage;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.imageio.*;
    import javax.imageio.stream.ImageOutputStream;
    import javax.media.jai.Interpolation;
    import javax.media.*;
    import javax.media.jai.JAI;
    import javax.media.jai.PlanarImage;
    import javax.media.jai.RenderedOp;
    import javax.media.jai.widget.ScrollingImagePanel;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.TIFFEncodeParam;
    import javax.media.jai.OperationDescriptorImpl;
    import java.io.*;
    import java.util.Iterator;
    import javax.media.jai.operator.*;
    // import javax.media.jai.widget.ScrollingImagePanel;
    public class crop {
              /** The main method. */
    public static void main(String[] args) {
    /* Validate input. */
    /* if (args.length != 1) {
    System.out.println("Usage: java JAISampleProgram " +
    "input_image_filename");
    // System.exit(-1);
    float a=(float) 70.3;
    float b=(float) 70.4;
    float c=(float) 3100.3;
    float d=(float) 5522.4;
    * Create an input stream from the specified file name
    * to be used with the file decoding operator.
    String TIFF="TIFF";
    FileSeekableStream stream = null;
    try {
         stream = new FileSeekableStream("D:\\tif images\\Nadeshiko_v1_02.tif");
    // stream = new FileSeekableStream("D:\\tif images\\Nadeshiko_v1_01.jpg");
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(0);
    // Load the source image from a Stream.
    RenderedImage im = JAI.create("stream", stream);
    RenderedImage image2= CropDescriptor.create(im, a, b, c, d, null);
    ScrollingImagePanel panel = new ScrollingImagePanel(image2, 100, 100);
    // Create a frame to contain the panel.
    Frame window = new Frame("JAI Image Cropping");
    window.add(panel);
    window.pack();
    // window.show();
    // Define the source and destination file names.
    // String inputFile = "D:\\tif images\\Nadeshiko_v1_05.tif";
    String outputFile = "D:\\tif images\\Nadeshiko_v1_04.tif";
    // Save the image on a file. We cannot just store it, we must set the image encoding parameters
    // to ensure that it will be stored as a tiled image.
    TIFFEncodeParam tep = new TIFFEncodeParam();
    tep.setWriteTiled(true);
    tep.setTileSize(80,80);
    JAI.create("filestore",image2,outputFile,"TIFF",null);
    try {
                   stream.close();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    </code>
    Thanks,
    Sanat Meher

    Try the following,
    TIFFEncodeParam tep = new TIFFEncodeParam();
    // Create {X,Y}Resolution fields.
    TIFFField fieldXRes = new TIFFField(0x11A, TIFFField.TIFF_RATIONAL,
                                        1, new long[][] {{DPI_X, 1}});
    TIFFField fieldYRes = new TIFFField(0x11B, TIFFField.TIFF_RATIONAL,
                                        1, new long[][] {{DPI_Y, 1}});
    tep.setExtraFields(new TIFFField[] {fieldXRes, fieldYRes});

  • Convert binary data (TIFF image) into XML - how ?

    Hi,
    I have the following requirement:
    1. A document is scanned and a TIFF image is saved in a directory
    2. The File adapter picks up the image file and sends into XI
    3. The binary data is converted into XML so a Web Service can be called (this web service will store the image in a database application)
    <b>The part I am struggling with is the convert of the incoming binary data into a XML format document which will allow the Web Service to be called.</b>
    Graphical mapping cannot be used therefore I am left with 3 options:
    1. XSLT mapping
    2. Java mapping
    3. ABAP mapping
    Can anyone suggest the best option to use in these circumstances and provide some sample snippet of code on how to do it.
    I am alright at XSLT mapping but this is beyond me and Java mapping is completely new to me as I have very limited Java knowledge.
    Thanks for your help
    Colin.

    Hi Colin
    Look for the below link
    https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
    <b>***Reward point if helpfull</b>
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b</a>

  • How to control the pixcel size in given tiff image

    Hai
    I loaded tiff image into the Frame by using the jai_core.jar and jai_codec.jar files. I am unable to control the pixcel size. It displaied default size. How to restract the pixcel on the image in Frame.
    import java.io.File;
    import java.io.IOException;
    import java.awt.Frame;
    import java.awt.image.RenderedImage;
    import javax.media.jai.widget.ScrollingImagePanel;
    import javax.media.jai.ImageLayout;
    import javax.media.jai.NullOpImage;
    import javax.media.jai.OpImage;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.TIFFDecodeParam;
    import com.sun.media.jai.codec.ImageDecoder;
    import com.sun.media.jai.codec.ImageCodec;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.imageio.ImageReadParam.*;
    class MultiPageRead extends JFrame
    ScrollingImagePanel panel;
    //     JFrame mainFrame = new JFrame();
         Container c;
         public MultiPageRead(String filename) throws IOException
    getContentPane();
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              pack();
              setTitle("Multi page TIFF Reader");
              setSize(980,1200);
              getContentPane();
    File file = new File(filename);
    SeekableStream s = new FileSeekableStream(file);
    TIFFDecodeParam param = null;
              ImageDecoder dec = ImageCodec.createImageDecoder("tiff", s, param);
    System.out.println("Number of images in this TIFF: " + dec.getNumPages());
              ImageLayout size = new ImageLayout(,0,12,12);
    // Which of the multiple images in the TIFF file do we want to load
    // 0 refers to the first, 1 to the second and so on.
    int imageToLoad = 0;
    RenderedImage op = new NullOpImage(dec.decodeAsRenderedImage(imageToLoad), null,
    OpImage.OP_IO_BOUND,
    size);
    // Display the original in a 800x800 scrolling window
    panel = new ScrollingImagePanel(op, 100, 200);
    getContentPane().add(panel);
         public static void main(String [] args)
    String filename = args[0];
    try {System.out.println("jfdfldjfldfjldjfjldjfjdjdjdjjdjdj");
              MultiPageRead window = new MultiPageRead(filename);
                        window.pack();
                        window.show();
              catch (java.io.IOException ioe)
              System.out.println(ioe);
    regards
    jaggayya

    Changing the fonts in Print using ABAP is not possible. as basic report output is a text editor.
    By changing "Customizing of Local Layout" will only change in display screen and not in print.
    One possible way to create a new printer formatr thry SPAD and use that format in while printing.
    to know more details about SPAD
    Using SPAD - SAP Spool Administration to print different paper size
    The SAP spool system manages its own output devices. This includes mostly printers, but also fax and archiving devices. In order for you to use output devices defined in your operating system from the SAP System, you must define these devices in the SAP spool system.
    Print to a dot matrix printer using computer paper with 66 lines
    Define paper types
    Formatting process Z_60_135
    Page format DINA4
    Orientation tick both Portrait and Orientation
    Type in the comment and click save
    Device initialization
    Device type - OKI341
    Formatting process Z_60_135 then click Execute
    Double click Printer initilization
    You must key the 66 lines hexadecimals for your printer. ( line no 9)
    1 # oki341 x_paper
    2 # reset
    3 # \e\0x40
    4 # select codepage multilingual 850
    5 \e\0x52\0x1a
    6 # disable skip perforation mode
    7 \e\0x4f
    8 # select 6 lpi
    9 \e\0x32
    10 # select page length 66 lines (66=hex $42)
    11 \e\0x43\0x42
    12 # select 10 cpi font
    13 \e\0x60
    CHECK THIS LINKS
    http://help.sap.com/saphelp_nw04s/helpdata/en/df/abbb3f8e236d3fe10000000a114084/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5a/4df93bad37f87ae10000000a114084/content.htm
    http://www.geocities.com/SiliconValley/Grid/4858/sap/Basis/printprobs_solutions.htm
    Hope this helps you
    Regards
    Pavan

  • JSP Tiff Image Display

    Hi all,
    I have a problem in displaying Tiff image in jsp page. I am using Internet Explorer 6.0 . I have installed Tiff Image plug-in from the site www.alternatiff.com. If the location of the image is given directly i can view the image. But through javascript function if I pass the location of the image to the embed tag src then it is not diplayed.
    i have posted the code:
    <html>
    <head>
    </head>
    <SCRIPT LANGUAGE="JavaScript">
              function submitpage()
                   alert(document.forms[0].image.value)
                   document.forms[0].img.src=document.forms[0].image.value               
                   alert (document.forms[0].img.src)
    </script>                                        
    <body >
    <form >
    <table border="0" cellpadding="0" cellspacing="0" align=center>
         <tr><td>Image Location : <input type="text" name="image" /></td></tr>
         <tr><td> <embed src=" " alt="Cheque Image will come here" width="600" height="300" name="img">      <tr><td>      
         <tr> <td colspan=4 align=center><input type=button name="click" value="Submit" onclick="submitpage()" /></center></td> </tr>
    </table>
    </form>
    </body>
    </html>
    Is there anyother way to view the tiff image.
    Thanks in advance for any suggestions.

    Then I guess your Javascript writes crap.
    Where's the Java part of your question?

  • Displaying a tiff image in a browser.

    Hi I need to display a tiff image in the browser which does not have a tiff plugin. I guess I have to convert the tiff to jpeg on the fly and write it in the output stream. Has anyone worked on this or knows any other way. Please not I dont want to create an intermediate jpeg file.

    Thanks for your help. I am having one problem though. The tiff file is not being read. The ImageIO.read(file); is returning null. I guess I am using the wrong ImageIO class.( javax.imageio.ImageIO;). I am pasting the code below. See if you can find out the bug.
    package tiffToJpg;
    import java.awt.image.BufferedImage;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.servlet.GenericServlet;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    * @author Deepak_Mulchandani
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class TiffToJpg extends GenericServlet
         public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException
              File file=new File("Demo1.jpg");
         ServletOutputStream servletOuputStream=response.getOutputStream();
                        BufferedImage image = ImageIO.read(file);
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
              JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(baos);
                        encoder.encode(image);
                   servletOuputStream.write(baos.toByteArray());
    }

  • How to display TIFF images?

    Hello all.
    My web application needs tiff images viewer with a very primitive functionality like zoom. I'm a new in working with graphics and it seems like java.awt.image package doesn't support TIFF images format. From searching this forum I understood there are 3 party products like JAI to work with those images.
    Can somebody send me an example of how to read and display those images with zooming option; and/or how to convert from tiff to GIF/JPG formats (which also can be a solution for me).
    If somebody has a ready applet that implements the required functionality and can share it with me, I would appreciate it very much.
    Email: [email protected]
    Thanks in advance.

    I am also looking for Tiff Image zooming functionality. Please through your ideas or suggestions. I will appreciate your advises. If anyone has developed API, Please let me know, I am ready to look in to it. I will appreciate your quick response.

  • View tiff image

    Hi
    I download the sample:Image Controls for long raw,Blob and interMedia Image Content on http://otn.oracle.com/sample_code/products/jdev/files/images/sample.html, this sample work fine, but only work with gif & jpeg images.
    My Database use longraw column and tiff format, and this image no display, but i can save in my hard disk in gif, jpg or jpeg format
    How i can change the sample, for work with tiff images?
    Jdeveloper 3.2.3

    Sorry, the BC4J interMedia control only supports GIF and JPEG. There is no way to display TIFF by using this control.
    The reason is that the control uses Swing ImageIcon class to display images. ImageIcon only supports GIF and JPEG. To display TIFF, the control needs to use Java Advanced Imaging(JAI). You may file a feature request to ask for TIFF support.
    Richard

  • Unable to view TIFF image in BSP page

    Hi ,
    I have put in the URL of a TIFF image in the BSP code to display the image but the image refuses to appear. I found out that a TIFF image does not appear even in a normal HTML page. Is there any way to make this possible.

    Hi,
    we had the same problem. As far as I know there is no "build in" way to display tiff-images with a browser.
    We use a Java-applet to do this. We use ViewOne from Daeja image systems. Look at <a href="http://www.daeja.com/">http://www.daeja.com/</a>. That works very good.
    Hope that helps.
    Best regards
    Renald

  • Viewing TIFF Images

    Hi All,
    how to view TIFF images(or any images in different format) in java
    please reply,
    Thanks
    Mahesh.

    Right, its the JAI-IO package you need:
    http://java.sun.com/products/java-media/jai/downloads/download-iio-1_0_01.html
    JAI is not required, but useful:
    http://java.sun.com/products/java-media/jai/downloads/download-1_1_2_01.html

  • Stamping tiff images

    Hello,
    I'm looking for a way in Java to stamp tiff images. The images have the following criteria: format A4, single page, black and white, g4 compressed, single strip offset. A formatted number has to be added in the right upper corner of each image.
    Could somebody give me a clue please how I can create a tiff-image from a String/a number and merge this image with the original image? I'm searching for an hour now but obviously I don't know the right key-words.
    Thank you!
    wowasa

    Hi, I just unchecked the Object Level Display and nothing happened.
    Nothing has changed with the images at all. The only thing that is different is that I created the manuscript in a trial version of the software. Maybe it was an earlier version than the software I purchased? Would that have an effect on the images? I didn't purchase the software directly from the trial version I used. What happened is that the trial version expired. Then a month later or so I bought a new laptop, bought the Creative Suite (Education version, so much cheaper than normal), and then installed the software on the laptop. Then I opened my manuscript using the new software, the CS5.5, and everything was fine except for the images being blurry.
    Is it possible I used a trial version in CS5.0 and then bought CS5.5 and that has something to do with it?
    Thanks for all of your help!!
    I just realized I wasn't logged in & that's why I couldn't reply.
    Message was edited by: patawhateverly

Maybe you are looking for

  • How to delete Init flag in a  process chain, before processing the init

    Hi, At the end of the week i need to re-execute the init request from ODS1 to ODS2. Therefore, i have to delete the init flag first and the requests in the CUBE1, everything automatically in the process chain. The schedule must be as follow : 1. Dele

  • Stereo preset for 3D Objects

    The stereo preset for 3d objects does not really work very well with the glasses I have. I am using the shrek glasses which I thought were blue and red, but they may be cyan and red. Is there a way to change the preset colors for this property or any

  • Upgraded 4s (iphone) can't figure out how to customize ringtone

    How can I put in my own ringtone?  I upgraded and now all I seem to be able to do is order a ringtone from itunes store, none of which I want. Can I have the ringtone I desire?

  • Why does the MSB toggle in serial mode when parity is enabled?

    Hello everyone, I created a small VI to read 1 byte of data across an RS-422 port. The data is then passed via a queue to another VI which displays the byte read. I have been testing the functionality of the VIs using HyperTerminal, and they seem to

  • Can't verify, repair or eject one of my internal drives,...

    disk utility, disk warrior,.. both can't unmount the drive,... can't drag to eject either,.. no busy files,... no open apps,... even tried the "lsof | egrep" command in terminal to list open files,.. nothing,... otherwise, the drive seems to be runni