Read TIF image properties

How can I read all the properties of TIFF like "SUMMARY", "TITLE" , "AUTHOR" etc.... which are actually seen when you RIGHT CLICK on the image?????
Also some of the images have additional custom tab named "imagedetails" which should also be read programmatically.
This custom tab is not normally displayed on right click. It is displayed when I install "eistream" imaging s/w.
I have seen java imaging api's but could not find which tag could read the right click properties of TIFF image.
Please suggest the right API for obtaining the right click properties of TIFF image file.

I am still getting problems here, but I don't know that my imagereader is correct.
public class Test {
     public static void main(String[] args) {
          File in = new File("te.tif");
          ImageReader reader = (ImageReader)ImageIO.getImageReadersByFormatName("tif").next();
          System.out.println("Found reader " + reader);
          ImageInputStream iis = new FileImageInputStream(in);
          reader.setInput(iis);
          System.out.println(in + " contains " + reader.getNumImages(true) + "pages");
          IIOImage iimage = reader.readAll(0, new ImageReadParam());
          IIOMetadata imageMetadata = reader.getImageMetadata(0);
          //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);
          TIFFField allFields = ifd.getTIFFField();
          for (int i = 0; i < allFields.length; i++) {
               TIFFField field = allFields;
               String name = field.getTag().getName();
               int number = field.getTagNumber();
               String type = TIFFField.getTypeName(field.getType());
               String value = field.getValueAsString(0);
               System.out.println("- " + name + ", " + number + ", " + type + ", " + value);
Thanks,
Steve

Similar Messages

  • Read Tif Image from Database Display in Windows Fax Viewer

    Code for reading a BLOB from Oracle which is a TIF image and displaying it in Windows Picture and Fax Viewer. Gives the ability to display with perfect resolution, Zoom In & Out, Rotate and Print.
    I m storing the image on my C drive, you can store where ever you want.
    package com.test.examples;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import oracle.sql.BLOB;
    public class Test {
         * Main method for calling the View Tif Image method.
         * @param args
         public static void main(String[] args) {
              String id = "123";
              Test test = new Test();
              test.viewTifImage(id);
         * Method for viewing TIF Image
         public void viewTifImage(final String id) {
              BLOB blob = null;
              FileOutputStream outStream = null;
              InputStream inStream = null;
              final String filename = "C:\\Images\\image.tif";
              if (Helper.stringNotNullAndEmpty(id)) {
                   try {
                        imageDAO = new ImageDAO();
                        blob = imageDAO.getImageBLOB(id);
                        File blobFile = new File(filename);
                        outStream = new FileOutputStream(blobFile);
                        inStream = blob.getBinaryStream();
                        int length = -1;
                        int size = new Long(blob.length()).intValue();
                        byte[] buffer = new byte[size];
                        while ((length = inStream.read(buffer)) != -1) {
                             outStream.write(buffer, 0, length);
                             outStream.flush();
                        showTiff(filename);
                        inStream.close();
                        outStream.close();
                   } catch (IOException ioe) {
                        System.out.println("Exception in IO block.");
                        ioe.printStackTrace();
                        try {
                             inStream.close();
                             outStream.close();
                        } catch (IOException ioe1) {
                             ioe1.printStackTrace();
                   }catch (DAOException daoe) {
                        System.out.println("Exception while getting the BLOB");
                        daoe.printStackTrace();
                   } catch (Exception ex) {
                        System.out.println("ERROR(djv_exportBlob) Unable to export:"
                                  + filename);
                        ex.printStackTrace();
                   } finally {
                        try {
                             inStream.close();
                             outStream.close();
                        } catch (IOException e) {
                             System.out.println("Exception in IO block.");
                             e.printStackTrace();
         public static boolean showTiff(String fileName) throws IOException {
              String progDir = System.getenv().get("SystemRoot");
              System.out.println("SYSTEM ROOT DIRECTORY" + progDir);
              // turn the backslash around to a forward slash
              int x = progDir.indexOf('\\');
              String front = progDir.substring(0, x);
              String back = progDir.substring(x + 1);
              progDir = front + "/" + back;
              String osCmd = progDir + "/system32/rundll32.exe " + progDir
                        + "/system32/shimgvw.dll,ImageView_Fullscreen " + fileName;
              try {
                   System.out.println("command is " + osCmd);
                   Runtime rt = Runtime.getRuntime();
                   Process ps = rt.exec(osCmd);
              } catch (IOException ie) {
                   System.out.println("error running fax viewer");
                   return false;
              return true;
    Let me know if you find some thing wrong in here.
    Thanks
    raffu

    REad all the file paths from DB in e.g. List<String>. Define javax.swing.Timer.
    How to use timer read here
    http://leepoint.net/notes-java/other/10time/20timer.html
    or
    http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html
    When the timer's actionPerformed happens use next index in the array to get next filePath and show your image. When end of list is achieved just stop the timer (or startd from the beginning of the list again).

  • How to load a tif image in flex

    Hi All,
    Is it possible to load a tif image in flex. If it's possible
    anyone guide me or send me some code snippets regarding how to
    display a tif image in flex.
    Regards,
    Dharma

    "flexdharma" <[email protected]> wrote in
    message
    news:ga2d96$p8h$[email protected]..
    >
    Hi All,
    > Is it possible to load a tif image in flex. If it's
    possible anyone guide
    > me or send me some code snippets regarding how to
    display a tif image in
    > flex.
    Convert it to the much more web-friendly png format.

  • How to get a .tif image with n different colors?

    Hi..i want to know how can i get a .tif image colored by some colors. I want to do something like this:
    if(tifImage.pixel < 0.1) {
    tifImage.pixel = yellow;
    else if( 0.1 <= tifImage.pixel && tifImage.pixel <0.5){
    tifImage.pixel = red;
    up to n colors.
    I prove the next code, but it is not getting the colors i want.
    public void generateImage(BufferedImage bi,double alto,double medio,String output){
              int width = bi.getWidth(); // Dimensions of the image
              int height = bi.getHeight();
              // Some constant colors (as arrays of integers).
              int[] red = {255, 0, 0};
              int[] green = {  0,255,  0};
              //int[] blue = {  0,  0,255};
              int[] yellow = {255,255, 0};
              //int[] background = { 85, 85, 85};
              int[] background = { 255, 255, 255};
              // The original image data will be stored on this array.
              int[][][] imageData = new int[width][height][3];
              // We'll fill the array with a test pattern bars thingie.
              double[] pixelArray=null;
              for(int w=0;w<width;w++)
                   for(int h=0;h<height;h++)
                        if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=9000){
                             //lo dejo blanco
                             imageData[w][h] = background;
                        else if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=alto){
                             //lo dejo rojo
                             imageData[w][h] = red;
                        else if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=medio){
                             //lo dejo amarillo
                             imageData[w][h] = yellow;
                        else{
                             //lo dejo verde
                             imageData[w][h] = green;
              // Now we have a color image in a three-dimensional array, where the
              // third dimension corresponds to the RGB components.
              // Convert the color image to a single array. First we allocate the
              // array.
              // Note that this array will have the pixel values composed on it, i.e.
              // each R,G and B components will yield a single int value.
              byte[] imageDataSingleArray = new byte[width*height*3];
              int count = 0;
              // It is important to have the height/width order here !
              for(int h=0;h<height;h++)
                   for(int w=0;w<width;w++)
                        // Rearrange the data in a single array. Note we revert RGB, I still don't
                        // know why.
                        imageDataSingleArray[count+0] = (byte)imageData[w][h][2];
                        imageDataSingleArray[count+1] = (byte)imageData[w][h][1];
                        imageDataSingleArray[count+2] = (byte)imageData[w][h][0];
                        count += 3;
              // Create a Data Buffer from the values on the single image array.
              DataBufferByte dbuffer = new DataBufferByte(imageDataSingleArray,width*height*3);
              // Create an pixel interleaved data sample model.
              SampleModel sampleModel =
                   RasterFactory.
                   createPixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
                             width,height,3);
              // Create a compatible ColorModel.
              ColorModel colorModel = PlanarImage.createColorModel(sampleModel);
              // Create a WritableRaster.
              WritableRaster raster = RasterFactory.createWritableRaster(sampleModel,dbuffer,new Point(0,0));
              // Create a TiledImage using the SampleModel.
              TiledImage tiledImage = new TiledImage(0,0,width,height,0,0,sampleModel,colorModel);
              // Set the data of the tiled image to be the raster.
              tiledImage.setData(raster);
              // Save the image on a file.
              JAI.create("filestore",tiledImage,output,"TIFF");
    Thanks

    I tried that. When I open one image and set the exposure, then go to open the second image, nothing happens. I then saved one image as a psd file, then it would let me open the raw file a second time. When I had both open on the same screen and dragged the layer from one into another image, the layer size ended up being different than the other file. It was shifted down and to the left. I need these images to be pixel locked, and the user experience I went through did not allow me to do this.
    I also do not see a way to copy/paste layers between files.

  • How to view image properties in safari

    I would like to view properties of an image on a web page in Safari and cannot find this option anywhere.  I think it used to be under "View".

    Control click the page in Safari then click Inspect Element.
    Select Images on the left.
    Click through the images in the list. You'll see image properties on the right.

  • Bridge doesn´t show preview of tif-images

    Hi,
    I uses Bridge CS6 on a Mac with MacOS 10.9.2. Suddenly bridge doesn´t show previews of Tif-images. It´s also impossible to fill in any metadata. The program also says that the image isn´t tagged with any color profile. I don´t have these problems with jpegs, only with Tif-images. I even get previews on the RAW-images. Does anyone know what the problem can be?
    Ulf

    I guess I have to try to reinstall the program.......
    I'm 99,99 % sure that won't help solving your problem because to possible being effective you also should use the Adobe Clean tool to get rid of a lot of the hidden files that just stay put during a normal reinstall. But if you want to do something easier instead of reinstall, quit Bridge and go to the user library (by default hidden per OSX 7, use Finder, menu Go with option to reveal this library)
    In the preferences folder is plist file for Bridge (com.adobe.bridge5.plist), drag this file to the trash. Then in same library go to the folder Caches / Adobe/ Bridge CS5 and inhere delete both plug in and folder called Cache. (this means recaching the previews and thumbs).
    Then restart Bridge holding down option key and again choose 'reset prefs'. All previous deleted items will be replaced with new, fresh and empty ones and you have an almost like factory settings Bridge without the need of reinstall.
    But I really suspect it comes down to the Tiff files so maybe also a reset of preferences in PS might be worth a try.

  • Image properties

    Anyone know how to extract image properties.
    I've a file upload which enables users to auto upload their photo.
    Restrictions on the upload need to be file size which I can do, and height/width to ensure the photo fits into a fixed window size. This is the bit I'm stuck on.
    The file upload uses jsp and java.
    Any help appreciated
    Thanks

    Please tell us more about your code.
    Do you have a Image or BufferedImage object at some point?
    If so can you use
    int w = yourImage.getWidth(null);

  • How do I open a TIF image email attachment using windows photo gallery as the default instead of microsoft office picture manager?

    I have an internet fax program that sends faxes directly to my email as a TIF image attachment. When I download the attachment it lists Microsoft office picture manager as the default program to view the image. I would like to change the default program to view the image to Microsoft photo gallery. How do I change the default program to open an image attachment in firefox? Thank you

    OK I have it figured out! I was using google mail. For what ever reason the imac/pc safari using google would not display the PDF in the email even though the ipad/iphone did. I tried a different mail system through work (not google mail) and it EVERYTHING works GREAT!!!!! Wow, a lot of wasted time over something that was actually working.

  • Viewing Tif images in a browser

    Hello all, please keep in mind that I know nothing about BEA so try to dumb down any of responses. :) Thanks. Here's the issue.
    My company has outsourced a project to a company and there's currently a problem with the program of viewing tif images in a browser through BEA that are stored on a seperate file server. However, they are all coming up garbled. What can I do to fix it? There's nothing wrong with the tif images because if I go directly to the file server, browse to the tif, right click it and choose to open with IE it comes up fine. My boss has asked me, of all people, to find the soution. Please help.
    Matt

    My guess is that the mime-type of the file request is coming back incorrect,
    which means that the browser doesn't know how to process the bits it gets
    back from WLS.
    You can compile and run this java class from the command line, passing in
    the same URL as you are in the browser and this will display all the headers
    you get back from WLS.
    You need to do two things. (possibly)
    1) if the file is being served by the web-server/web-app then you need to
    add a mime-type entry in the web.xml for the web-app in question
    <mime-mapping>
    <extension>.tiff</extension>
    <mime-type>app/tiff</mime-type>
    </mime-mapping>
    I dont kow the actual mime-type for tiff, but you can look it up on google.
    2) if the file is being supplied by streaming it from disk by a servlet,
    then you need to make sure that servlet sets the appropriate mime-type.
    Cheers
    mbg
    "Matt" <[email protected]> wrote in message
    news:3fbce312$[email protected]..
    Hello all, please keep in mind that I know nothing about BEA so try todumb down any of responses. :) Thanks. Here's the issue.
    >
    My company has outsourced a project to a company and there's currently aproblem with the program of viewing tif images in a browser through BEA that
    are stored on a seperate file server. However, they are all coming up
    garbled. What can I do to fix it? There's nothing wrong with the tif images
    because if I go directly to the file server, browse to the tif, right click
    it and choose to open with IE it comes up fine. My boss has asked me, of all
    people, to find the soution. Please help.
    >
    Matt[GetHeaders.java]

  • How to set image properties ?

    Dear All,
    I need your help to set image properties like (Title , Subject , Comments .... )
    thanks

    NVidia writes the DDS file format plugin, you need to talk to them about it.

  • IPhoto Image Properties

    Im totally confused about image properties and the effect on images when downloaded into iPhoto of different releases:
    I have Canon digital camera. I always shoot at max image and file size...not Raw.
    I had my MacBook on a vacation in Europe and pulled images into iPhoto (V6)every day to preserve in case of loss. I then made a daily CD for double keeping.
    When I returned home I wanted the images on my iMac so I loaded into iPhoto (V5) from the backup CD made from the MacBook iPhoto (V6).
    I noticed differences in image properties (file size and resolution) when opened in Photoshop so I did the following experiment:
    I uploaded from the camera the last set of images directly into the iMac (iPhoto V5). I then compared image properties between the same image, from the CD via the MacBook and from the camera directly...and the iMac direct loaded images were larger, 3.2 MB v. 2.3 MB. I also checked the direct loaded images on the MacBook (iPhoto V6) and it is also 2.3 MB. I concluded the CD had nothing to do with the image quality/size.
    It appears that iPhoto V6 for some reason loades the image as a smaller and thus lower quality image than the iPhoto V5 on the iMac.
    Can anyone explain where the differences are coming from...???
    iMAC and MacBook   Mac OS X (10.4.8)   PhotoShop and iPhoto
    iMAC   Mac OS X (10.4.8)   PhotoShop

    Welcome to Apple Discussions,
    What model of Kodak is it?
    There is a discussion thread on this topic: http://discussions.apple.com/thread.jspa?messageID=11942367&#11942367
    Try using a media card reader (sometimes built into printers) to see if that allows the import. Others seem to report having luck by importing the movies off the card using a different computer, deleting them, and then importing the pictures.
    Hope that helps.

  • Reading MRSID Image format

    Does anyone know where can I find somthing to read MRSID image format.
    I find that exists a plug-in but it operates only using browser.
    The problem is that I have to load an MRSID image like I do with jpge,tif ...
    Thanks to all.
    Stefano

    Hello,
    The Decode SDK is available from lizardtech now:
    http://developer.lizardtech.com/
    the only problem is it is written in C++. I'm willing to pay someone $300 US to port it to Java or at least make a jni port. So I could use java commands like:
    MrSidFile mrsid = new MrSidFile("c:\test.sid");
    mrsid.setView(330, 223, 5003, 4890);
    mrsid.drawView(graphics2d, 0, 0, render.width, render.height);Thanks,
    Eric

  • Displaying TIF images from a Servelet?

    Hi All,
    I have a servlet sitting between database of Images (of type bmp, tif, DICOM) and the HTML query interface.
    Baed on the user's input, the servlet queries the database and displays the images. The servelt's code contains
    out.println("<a href=\"javascript:NewWindow(1,'" + url + "','" + fname+"')\"><img src = \"" + url + "\" width = \"100\" height = \"100\" alt = \"" + url+"\" />  </a><br>" + fname + "<br><br>");
    where url is the path to get the image on the disk.
    This works successfully for bmp images but not for tif images. Somebody told me, it does not display tif because IE does not display tif. I would like it to display DICOM images later.
    Any suggestions?

    1. Convert the image to a format that IE understands.
    2. Use a decent browser.

  • Adobe Form print/email - Attach IXOS .tif images via string table param?

    I am attempting to create an Adobe Form print/e-mail output for Invoices, with zero, one or many attached pages from the IXOS archive.  (TIFF files.)  So far I have managed to attach exactly one IXOS image.  Now I need to make the number of attached images dynamic.
    This is in Netweaver 7.0 / ECC 6.0 ehp 3 / LiveCycle Designer 8.1.
    My ABAP driver program is a copy of SD_INVOICE_PRINT01.  In pseudocode, I've added:
    Logic to identify correct IXOS image.
    Logic to extract IXOS image to application server's file system.
    OPEN DATASET image.tif FOR INPUT IN BINARY MODE.
    READ DATASET image.tif INTO xstring.
    CALL FUNCTION 'SSFC_BASE64_ENCODE' EXPORTING xstring IMPORTING string.
    APPEND string TO string_table.
    CALL FUNCTION form_name EXPORTING attachments = string_table.
    The form interface is a copy of INVOICE_INTERFACE (ABAP dictionary-based.)  I've added import param. ATTACHMENTS type STRING_TABLE.
    In the form's context tab, interface import param. ATTACHMENTS was dragged & dropped onto the context pane, yielding:
    - Table ATTACHMENTS
    -- Structure DATA
    --- Field ITEM.
    In Adobe LiveCycle Designer 8.1, I *can* create an image field with binding ATTACHMENTS.DATA[1].ITEM - that prints the TIFF from IXOS just fine.
    What *does not* work is placing ATTACHMENTS on the form as a table of image fields.  I've tried several combinations - most look like this:
    - Table or Subform ATTACHMENTS, binding ATTACHMENTS, repeat for each data item max = 1.
    -- Row or Subform DATA, binding DATA[*], repeat for each data item min = 1.
    --- Image field ITEM, binding ITEM.
    The result is consistently one blank page.  No more, no less.
    Can anyone help?
    Edited by: Eric Hopp on May 12, 2010 12:09 AM

    Hello,
    I have no experience regarding the table of pictures, but you could try a workaround if you don´t insist of displaying the images. You could attach the pictures as attachments (you know, the little attachments icon on the left in your Reader). The ABAP coding for this can be found in SE38 FP_* and when you check the descriptions you should be able to find the one working with the attachments.
    Would be better than nothing I guess,
    Otto

  • How to convert a black and white tif image to colour

    I want to convert a black and white tif image to colour. I opened it in Photoshop, changed the mode to RGB colour/8, saved it as psd, but when I use the Replace Colour dialogue box, I just get my colour showing as grey-scale. What’s the correct way to proceed?
    Thank you

    What’s the correct way to proceed?
    Joke?
    In Photoshop there are often more ways than one to achieve a task and none of them need be considered »wrong« as long as the result fits the intention, so »the correct way« seems to be problematic terminology.
    Anyway, one can use a Layer set to Blend Mode Color and paint on that with whatever colors.
    Or one can use Solid Color Layers set to Blend Mode Color.
    Or Hue/Saturation Layers …
    To edit contrast if necessary Curves or Levels Adjustment Layers can be employed.
    You could also have googled »photoshop colorize black and white« …

Maybe you are looking for

  • MS-Word mail merge funcionality

    I would like to have an editor with functionalities similar to MS-Word's mail merge. My website should be able to publish templates with dynamic data, from an external database. Can I have it with Muse or any other Adobe product ?

  • How to execute Java program in Solaris 8 (Intel Platform).

    Hello All, I have installed Solaris 8 on my Intel based PC. JDk 1.1 and JDK 1.2 is installed by default. When I compile any Java applet or Application, it successfull complies but when I try run that applet or application (java Appletname or applicat

  • Complaint re BTYahoo server hacked last year

    Most will be aware of this dreadful episode thoroughly covered (but with no real answers from BT) in this thread: https://community.bt.com/t5/Email/BT-email-account​s-hacked/td-p/796762 I am the secretary of a local Crown Green Bowling Club and  I'd

  • Ideas on storing version (ptf) info at the class level

    Our product is regulated by the FDA and so must do a lot of extra documentation chores. One thing we need to do is track version numbers (we call 'em PTF's) for each source file and .class file. We are playing with ideas on an easy way to go about th

  • Firefox 4 slowes down after some time - possibly memory leak related

    After couple minutes of intensive Firefox 4 usage (multiple tabs opened and closed, however no more than 15 tabs open simultanously) browser becomes '''unresponsive''' and periodically '''generates high cpu load''' (100% of one of two cores for about