TIFF Images Orientation

How can I distinguish whether TIFF Image which contains a Text if it is portrait or landscape??
Explanation:
1. TIFF image represents an A4 paper size.
2. This paper contains Text inside it.
3. TIFF Image (paper) should be displayed (flipped) according the Text orientation.
4. Need to figure out the right orientation for the TIFF image to be displayed.

you are right, i was reading about that, and i need to integrate a kind of OCR with my application, then i can flip the image according the text direction.
the user is a naive end user, and I should assume that he do not know how to deal with the computer :P
now there are a lot of job to do :) guess i have to start.

Similar Messages

  • 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

  • CameraRoll & CameraUI image orientation

    Hi,
    I am trying to read the Orientation tag in EXIF image data grabbed with CameraRoll or CameraRollUI using AIR 3.6 on iOS 6.1
    To achieve this, I use this library coded by Christian Cantrell :
    http://blogs.adobe.com/cantrell/archives/2011/10/parsing-exif-data-from-images-on-mobile-d evices.html
    Unfortunantly, it raises an error when I try to parse the Byterray containing the EXIF data :
    var exifInfo:ExifInfo = new ExifInfo( eb );
    TypeError: Error #1034: Type Coercion failed: cannot convert "<tags level="0th IFD TIFF Tags">
      <tag tag_name="Image width" field_name="ImageWidth" id="0x0100" compressed="J">
        <uncompressed chunky="M" planar="M" ycc="M" />
      ... INSERT BIG CHUNK OF XML HERE ...
    </tags>" to XML.
              at jp.shichiseki.exif::ExifInfo/readIFDs()[/Users/***/Google Drive/AS3/libs/jp/shichiseki/exif/ExifInfo.as:100]
              at jp.shichiseki.exif::ExifInfo()[/Users/***/Google Drive/AS3/libs/jp/shichiseki/exif/ExifInfo.as:63]
    It seems that Air can't cast the data into XML, but it's kind of crazy because I am able to see all the data in the error text (I purposedly truncated it here for not flooding this post) and it's XML valid. I had a look into the ExifInfo class, but it's hard to see where the error comes from.
    I really need to get access to these data, since it's the only way to determine image orientation in iOS. Or is there any native extention thaht I could use to achieve this ?
    Any advice will be welcome as I am stuck on a project for a client because of this.
    Thank you all !

    Hello Frog,
    a very (very) dirty solution could be :
    - use a try...catch...finally block to prevent the error raising
    - in the catch block, parse the error message to get your orientation value (String method, regexp...)
    [code]
    var myExifData:XML;
    try {
         // try to get the exif data
         var exifInfo:ExifInfo = new ExifInfo( eb );
    } catch(err:Error) {
         // fails, but maybe I can get the exif info in the error message...
         myExifData = parseExifError(err.message); // parse the error message to get your orientation info...
    } finally {
        do what I have to do with my image : rotate, scale....
    [/code]
    BTW, PhoneGap is perfectly able to get orientation of an image from the camera roll. So there IS a solution somewhere.
    Maybe you could try to make a native extension ? It's not so hard for little things like that...
    My 2 cents
    Nicolas

  • Camera image orientation on iOS

    Hi,
    Taking a picture using CamerUI on iOS (and on Android) may bring the image oriented in the wrong angle.
    Reading the Exif on Android is fine and allows reorientation to the correct position, however this is not working on iOS.
    Since I assume taking a picture using the camera is a core feature for many applications, I’d appreciate if someone who managed to solve it can post a solution here?
    Thanks!

    I think this is it:
    // ExifReader.as
    // Reads and obtains JPG EXIF data.
    // Project site: http://devstage.blogspot.com/2011/02/extract-jpg-exif-metadata-in.html
    // SAMPLE USAGE:
    // var reader:ExifReader = new ExifReader();
    // reader.addEventListener(Event.COMPLETE, function (e:Event):void{
    //     trace(reader.getKeys());
    //     trace(reader.getValue("DateTime"));
    //     trace(reader.getThumbnailBitmapData().width +'x' + reader.getThumbnailBitmapData().height);
    // reader.load(new URLRequest('myimage.jpg'), true);
    package
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.Loader;
        import flash.display.LoaderInfo;
        import flash.events.Event;
        import flash.events.EventDispatcher;
        import flash.events.ProgressEvent;
        import flash.net.URLRequest;
        import flash.net.URLStream;
        import flash.utils.ByteArray;
        public class ExifReader extends EventDispatcher
            private var m_loadThumbnail:Boolean = false;
            private var m_urlStream:URLStream = null;
            private var m_data:ByteArray = new ByteArray();
            private var m_exif:Object = new Object;
            private var m_exifKeys:Array = new Array();
            private var m_intel:Boolean=true;
            private var m_loc:uint=0; 
            private var m_thumbnailData:ByteArray = null;
            private var m_thumbnailBitmapData:BitmapData=null;
            private var DATASIZES:Object = new Object;
            private var TAGS:Object = new Object;
            public function load(urlReq:URLRequest, loadThumbnail:Boolean = false):void{
                m_loadThumbnail = loadThumbnail;  
                m_urlStream = new URLStream();
                m_urlStream.addEventListener( ProgressEvent.PROGRESS, dataHandler);
                m_urlStream.load(urlReq);
            public function getKeys():Array{
                return m_exifKeys;
            public function hasKey(key:String):Boolean{
                return m_exif[key] != undefined;
            public function getValue(key:String):Object{
                if(m_exif[key] == undefined) return null;
                return m_exif[key];
            public function getThumbnailBitmapData():BitmapData{
                return m_thumbnailBitmapData;
            public function ExifReader(){
                DATASIZES[1] = 1;
                DATASIZES[2] = 1;
                DATASIZES[3] = 2;
                DATASIZES[4] = 4;
                DATASIZES[5] = 8;
                DATASIZES[6] = 1;  
                DATASIZES[7] = 1;
                DATASIZES[8] = 2;
                DATASIZES[9] = 4;
                DATASIZES[10] = 8;
                DATASIZES[11] = 4;
                DATASIZES[12] = 8;
                TAGS[0x010e] = 'ImageDescription';
                TAGS[0x010f] = 'Make';
                TAGS[0X0110] = 'Model';
                TAGS[0x0112] = 'Orientation';
                TAGS[0x011a] = 'XResolution';
                TAGS[0x011b] = 'YResolution';
                TAGS[0x0128] = 'ResolutionUnit';
                TAGS[0x0131] = 'Software';
                TAGS[0x0132] = 'DateTime';
                TAGS[0x013e] = 'WhitePoint';
                TAGS[0x013f] = 'PrimaryChromaticities';
                TAGS[0x0221] = 'YCbCrCoefficients';
                TAGS[0x0213] = 'YCbCrPositioning';
                TAGS[0x0214] = 'ReferenceBlackWhite';
                TAGS[0x8298] = 'Copyright';
                TAGS[0x829a] = 'ExposureTime';
                TAGS[0x829d] = 'FNumber';
                TAGS[0x8822] = 'ExposureProgram';
                TAGS[0x8827] = 'IsoSpeedRatings';
                TAGS[0x9000] = 'ExifVersion';
                TAGS[0x9003] = 'DateTimeOriginal';
                TAGS[0x9004] = 'DateTimeDigitized';
                TAGS[0x9101] = 'ComponentsConfiguration';
                TAGS[0x9102] = 'CompressedBitsPerPixel';
                TAGS[0x9201] = 'ShutterSpeedValue';
                TAGS[0x9202] = 'ApertureValue';
                TAGS[0x9203] = 'BrightnessValue';
                TAGS[0x9204] = 'ExposureBiasValue';
                TAGS[0x9205] = 'MaxApertureValue';
                TAGS[0x9206] = 'SubjectDistance';
                TAGS[0x9207] = 'MeteringMode';
                TAGS[0x9208] = 'LightSource';
                TAGS[0x9209] = 'Flash';
                TAGS[0x920a] = 'FocalLength';
                TAGS[0x927c] = 'MakerNote';
                TAGS[0x9286] = 'UserComment';
                TAGS[0x9290] = 'SubsecTime';
                TAGS[0x9291] = 'SubsecTimeOriginal';
                TAGS[0x9292] = 'SubsecTimeDigitized';
                TAGS[0xa000] = 'FlashPixVersion';
                TAGS[0xa001] = 'ColorSpace';
                TAGS[0xa002] = 'ExifImageWidth';
                TAGS[0xa003] = 'ExifImageHeight';
                TAGS[0xa004] = 'RelatedSoundFile';
                TAGS[0xa005] = 'ExifInteroperabilityOffset';
                TAGS[0xa20e] = 'FocalPlaneXResolution';
                TAGS[0xa20f] = 'FocalPlaneYResolution';
                TAGS[0xa210] = 'FocalPlaneResolutionUnit';
                TAGS[0xa215] = 'ExposureIndex';
                TAGS[0xa217] = 'SensingMethod';
                TAGS[0xa300] = 'FileSource';
                TAGS[0xa301] = 'SceneType';
                TAGS[0xa302] = 'CFAPattern';
                //... add more if you like.
                //See http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
            private function dataHandler(e:ProgressEvent):void{
                //EXIF data in top 64kb of data
                if(m_urlStream.bytesAvailable >= 64*1024){
                    m_urlStream.readBytes(m_data, 0, m_urlStream.bytesAvailable);
                    m_urlStream.close();
                    processData();
            private function processData():void{
                var iter:int=0;
                //confirm JPG type
                if(!(m_data.readUnsignedByte()==0xff && m_data.readUnsignedByte()==0xd8))
                    return stop();
                //Locate APP1 MARKER
                var ff:uint=0;
                var marker:uint=0;
                for(iter=0;iter<5;++iter){ //cap iterations
                    ff = m_data.readUnsignedByte();
                    marker = m_data.readUnsignedByte();
                    var size:uint = (m_data.readUnsignedByte()<<8) + m_data.readUnsignedByte();
                    if(marker == 0x00e1) break;
                    else{
                        for(var x:int=0;x<size-2;++x) m_data.readUnsignedByte();
                //Confirm APP1 MARKER
                if(!(ff == 0x00ff && marker==0x00e1)) return stop();
                //Confirm EXIF header
                var i:uint;
                var exifHeader:Array = [0x45,0x78,0x69,0x66,0x0,0x0];
                for(i=0; i<6;i++) {if(exifHeader[i] != m_data.readByte()) return stop();}
                //Read past TIFF header
                m_intel = (m_data.readByte()!=0x4d);
                m_data.readByte(); //redundant
                for(i=0; i<6;i++) {m_data.readByte();} //read rest of TIFF header
                //Read IFD data
                m_loc = 8;
                readIFD(0);
                //Read thumbnail
                if(m_thumbnailData){
                    var loader:Loader = new Loader();
                    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbnailLoaded);
                    loader.loadBytes(m_thumbnailData);
                else stop();
            //EXIF data is composed of 'IFD' fields.  You have IFD0, which is the main picture data.
            //IFD1 contains thumbnail data.  There are also sub-IFDs inside IFDs, notably inside IFD0.
            //The sub-IFDs will contain a lot of additional EXIF metadata.
            //readIFD(int) will help read all of these such fields.
            private function readIFD(ifd:int):void{
                var iter:int=0;
                var jumps:Array = new Array();
                var subexifJump:uint=0;
                var thumbnailAddress:uint=0;
                var thumbnailSize:int=0;
                // Read number of entries
                var numEntries:uint;
                if(m_intel) numEntries = m_data.readUnsignedByte() + (m_data.readUnsignedByte()<<8);
                else numEntries = (m_data.readUnsignedByte()<<8) + (m_data.readUnsignedByte());
                if(numEntries>100) numEntries=100; //cap entries
                m_loc+=2;
                for(iter=0; iter<numEntries;++iter){
                    //Read tag
                    var tag:uint;
                    if(m_intel) tag = (m_data.readUnsignedByte()) + (m_data.readUnsignedByte()<<8);
                    else tag = (m_data.readUnsignedByte()<<8) + (m_data.readUnsignedByte());
                    //read type
                    var type:uint;
                    if(m_intel) type = (m_data.readUnsignedByte()+(m_data.readUnsignedByte()<<8));
                    else type = (m_data.readUnsignedByte()<<8)+(m_data.readUnsignedByte()<<0);
                    //Read # of components
                    var comp:uint;
                    if(m_intel) comp = (m_data.readUnsignedByte()+(m_data.readUnsignedByte()<<8) + (m_data.readUnsignedByte()<<16) + (m_data.readUnsignedByte()<<24));
                    else comp = (m_data.readUnsignedByte()<<24)+(m_data.readUnsignedByte()<<16) + (m_data.readUnsignedByte()<<8) + (m_data.readUnsignedByte()<<0);
                    //Read data
                    var data:uint;
                    if(m_intel) data= m_data.readUnsignedByte()+(m_data.readUnsignedByte()<<8) + (m_data.readUnsignedByte()<<16) + (m_data.readUnsignedByte()<<24);
                    else data = (m_data.readUnsignedByte()<<24)+(m_data.readUnsignedByte()<<16) + (m_data.readUnsignedByte()<<8) + (m_data.readUnsignedByte()<<0);
                    m_loc+=12;
                    if(tag==0x0201) thumbnailAddress = data; //thumbnail address
                    if(tag==0x0202) thumbnailSize = data;  //thumbnail size (in bytes)
                    if(TAGS[tag] != undefined){
                        //Determine data size
                        if(DATASIZES[type] * comp <= 4){
                            //data is contained within field
                            m_exif[TAGS[tag]] = data;
                            m_exifKeys.push(TAGS[tag]);
                        else{
                            //data is at an offset
                            var jumpT:Object = new Object();
                            jumpT.name = TAGS[tag];
                            jumpT.address=data;
                            jumpT.components = comp;
                            jumpT.type = type;
                            jumps.push(jumpT);
                    if(tag==0x8769){ // subexif tag
                        subexifJump = data;
                var nextIFD:uint;
                if(m_intel) {
                    nextIFD= m_data.readUnsignedByte()+(m_data.readUnsignedByte()<<8) + (m_data.readUnsignedByte()<<16) + (m_data.readUnsignedByte()<<24);
                else {
                    nextIFD = (m_data.readUnsignedByte()<<24)+(m_data.readUnsignedByte()<<16) + (m_data.readUnsignedByte()<<8) + (m_data.readUnsignedByte()<<0);
                m_loc+=4;
                //commenting this out, as suggested in the comments.
                //if(ifd==0) jumps = new Array();
                for each(var jumpTarget:Object in jumps){
                    var jumpData:Object = null;
                    for(;m_loc<jumpTarget.address;++m_loc)m_data.readByte();
                    if(jumpTarget.type==5){
                        //unsigned rational
                        var numerator:uint = m_data.readInt();
                        var denominator:uint = m_data.readUnsignedInt();
                        m_loc+=8;
                        jumpData = numerator / denominator;
                    if(jumpTarget.type==2){
                        //string
                        var field:String='';
                        for(var compGather:int=0;compGather<jumpTarget.components;++compGather){
                            field += String.fromCharCode(m_data.readByte());
                            ++m_loc;
                        if(jumpTarget.name=='DateTime' ||
                            jumpTarget.name=='DateTimeOriginal' ||
                            jumpTarget.name=='DateTimeDigitized'){
                            var array:Array = field.split(/[: ]/);
                            if(parseInt(array[0]) > 1990){
                                jumpData = new Date(parseInt(array[0]), parseInt(array[1])-1,
                                    parseInt(array[2]), parseInt(array[3]),
                                    parseInt(array[4]), parseInt(array[5]));
                        else jumpData = field;
                    m_exif[jumpTarget.name] = jumpData;
                    m_exifKeys.push(jumpTarget.name);
                if(ifd==0 && subexifJump){
                    //jump to subexif area to obtain meta information
                    for(;m_loc<data;++m_loc) m_data.readByte();
                    readIFD(ifd);
                if(ifd==1 && thumbnailAddress && m_loadThumbnail){
                    //jump to obtain thumbnail
                    for(;m_loc<thumbnailAddress;++m_loc) m_data.readByte();
                    m_thumbnailData = new ByteArray();
                    m_data.readBytes(m_thumbnailData, 0, thumbnailSize);
                    return;
                // End-of-IFD
                // read the next IFD
                if(nextIFD){
                    for(;m_loc<nextIFD;++m_loc) m_data.readUnsignedByte();               
                if(ifd==0 && nextIFD)
                    readIFD(1);
            private function thumbnailLoaded(e:Event):void{
                m_thumbnailData.clear();
                var loader:LoaderInfo = e.target as LoaderInfo;
                var bitmap:Bitmap = loader.content as Bitmap;
                if(bitmap != null){
                    m_thumbnailBitmapData = bitmap.bitmapData;
                stop();
            // Releases m_data and dispatches COMPLETE signal.
            private function stop():void{
                m_data=null;
                dispatchEvent(new Event(Event.COMPLETE));
                return;

  • A generic error occurred in GDI+ while assing tiff image file to Bitmap and Image

    Hi,
    I am getting "A generic error occurred in GDI+" error while reading the tiff image file to Bitmap or Image.
    Below is my sample code.
    string filePath=@"c:\Images\sample.tif";
    Bitmap bmp=new Bitmap(filePath);   // here getting exception
    int totalpages=bmp.GetFrameCount(.....);
    etc......
    I tried using Bitmap.FromFile() and also from FromStream() even for Image also but there is no use.
    Moreover i m having full permissions for the file path and the tiff file is having multiple pages.
    Can anyone help me to solve this issue please.
    Thanks & Regards,
    Kishore
    Kishore

    Make sure that the Tif file is valid (can other software open it)?  If you are able to save a Tif using GDI+, try saving that Tif, then opening it.  Part of me wonders if there is something about that specific Tif that GDI+ doesn't like.
    You could also try using WIC to open the TIF, perhaps you would have better luck there.

  • 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?

  • Image Orientation/Rotation Problem in Lightroom 3.2 Final

    This is a continuation of my previous post regarding this same problem in 3.2RC. It's still happening in the Final version of Lightroom 3.2.
    THE PROBLEM
    Image orientation is not working properly in Lightroom 3.2. This affects newly imported images and images that were already in my Lightroom database -  and which have been in the database since Version 1.
    Here's a screen capture showing the strange displays I'm seeing in  Lightroom's grid mode:
    Notice the odd angle of the image. When I use the Rotate Photo Left tool, the display looks like this sometimes. After a second or so, it will snap to either a vertical or horizontal orientation by itself but rarely gives me the 90-degree rotation this tool should give. The image may flip 90-degrees or 180-degrees, there's no way to tell.
    When I view the image in Loupe view or on my second monitor, the orientation shown in Grid view does not match that displayed in Loupe Vew. For this particular image, Grid view currently shows it as correctly orientated as a horizontal while Loupe view shows it rotated 90-degrees to the right. Shouldn't they match?
    BACKGROUND
    I never had a problem with image orientation in any preveious version of Lightroom prior to Lightroom 3.2RC and 3.2 Final. So, it seems to be a bug in 3.2. I'm still using the same computer and video card I used with previous versions. My operating system is Windows 7 Home Premium. Both Windows and Lightroom are 64-bit.
    HELP!
    Is anyone else having this problem? How can I solve it?
    Alan
    PhtooCitizen.com

    The size of the catalogue is almost certainly not at play here.
    FWIW, I recall seeing something like this once a long time ago on a Mac, possibly with Lr 3 beta, or Lr 2.x.  It went away with a restart. It almost looks like a threading issue, where a thread is suspended or preempted and then is lost or disconnected from the main UI thread.
    I recall you can just rotate the image again and it will right itself.
    Adobe fist-line support seem to want to use the number of images in the catalogue as some sort of catch-all.  The problem with this is that most of us can demonstrate that there is little correspondence with the number of image IDs in the database and many reported UI artefacts.
    I'd keep raising this with them, and suggesting that the size of the catalogue is probably not at play here. As a tactic, you can ask what the maximum size of a catalogue should be, and if it is raw images or the number of changes to the images and virtual copies that is the problem, and if this can be verified by second- or third-line support.

  • 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 do I Convert a  Tiff image to a jpeg without being FORCED to 8-bit Color?

    I am an Artist.  I have High quality TIFF images.  When I convert the tiffs to jpeg it forces me into 8-bit color automatically. (Forget about 32bit - it will not allow me to jpeg that at all)   The only way I can get back to 16bit color is to use the already SMAshed file and bring it up to 16bit.  THIS makes NO sense.  Once the jpeg is smashed, HOw in the world is it supposed to convert up again. ??  Then even though it says you converted the file to 16 -bit , the metadata refers still to the file as 8-bit.
    On top of all of that confusion, One picture, for example, when supposedly converted to 16bit,  gets much BRighter then even the original Tiff image.  It looks good on one hand and over exposed on the other.  I assume that is photoshop throwing in fake resolution, am I right?
    Am I wasting my time with this imaginary 16bit conversion?
    Is there ANY way to take that original Tiff image and convert it to 16bit jpeg without the Default 8bit?  I have been trying all kinds of things.  I even have asked my web guy.  My web guy says that 8-bit is unexceptable for printing, even for web.
    Could this have anything to do with my computer and scanner?
    I have the iMAC OS X 10.8.3 (3.2 GHz) 8 GB memory.
    And I also have an Epson Expression 10000XL graphic arts scanner capable of scanniing at 48bit color.
    This color stuff Really matters!  It MATTERS!  I HAve FINE art files.  I am already losing so much quality with the jpeg conversion. (which I am required to do for SmugMug, in addition to compressing all my files to 50mb or Under)
    Anyone who knows anything that could help me would be much appreciated. 
    Aloha,
    -Melissa

    First of all jpeg is 8 bit only there is no way to save as a 16 or 32 bit jpg, just does not exist. Secondly people print in 8 bit all the time and most if not all web graphics are in 8 bit as that is the only way to view it as there is no 16 bit or 32 bit monitors to view it. All but a few pro monitors are 8 bit monitors.
    If you care about the color gamut and want the full range of color that 16 and 32 bit provide, then why jpg? Jpg by its own nature throws out color just to compress, thats why it is popular on the web, because of its small file size not its quality. If you need 16 or 32 bit for anything it must be in a format that supports that color depth.
    That being said a jpg image at 8 bit will display 16+ million colors,  256 shades of red, 256 shades of green and 256 shades of blue.
    Now here is where I think your bit information is off. a jpg image is a 24 bit image that will produce 8 bits of red, 8 bits of green and 8 bits of blue.
    The 8, 16 and 32 are per channel not total color information.
    If the overall image was 8 bits, the image would be gayscale.

  • 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);
       }

  • Trying to display multipage tiff image getting error

    Hi
    I am trying to read multipage tiff image but dont know how
    I tried to display single page tiff getting error
    my code is
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Drawing;
    using System.Drawing.Imaging;
    namespace Documentviewer1
        public partial class _Default : System.Web.UI.Page
            //string filepath = "";
            protected void Page_Load(object sender, EventArgs e)
                //// filepath = "image\045237302.tif";
                string appath = Server.MapPath("/image") + @"\";
                string imagename = Request.QueryString["ImageFileName"];
                string filename = appath + imagename;
                Response.ContentType = "image/tiff";
                new Bitmap(filename).Save(Response.OutputStream, ImageFormat.Tiff);
                ////System.Drawing.Image TheImg = new App.Files.TIF(Request.QueryString["FilePath"]).GetTiffImageThumb(System.Convert.ToInt16(Request.QueryString["Pg"]), System.Convert.ToInt16(Request.QueryString["Height"]),
    System.Convert.ToInt16(Request.QueryString["Width"]));//getting error in thisline Parameter not valid
    my aspx page is has
    <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
        CodeBehind="Default.aspx.cs" Inherits="Documentviewer1._Default" %>
    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    </asp:Content>
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <h2>
          <img alt="" src ="image/045237302.tif" width="200" height="200"/>
        </h2>
        <p>
            To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>.
        </p>
        <p>
            You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409"
                title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.
        </p>
    </asp:Content>
    getting error as Parameter not valid.
    Can anybody help me to display the image in the browser.
    Thanks
    Mary Abraham
    Mary Sunish

    Hi MaryAbraham,
    Since the issue regards ASP.NET and website deployment. I suggestion you post the question in the ASP.NET forums at
    http://forums.asp.net/. It is appropriate and more experts will assist you.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • 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});

  • How to edit 16bit TIFF image sequence file in FCP?

    Dear all,
    I have a number of 16 bit TIFF image sequence files (2048 x 1024 resolution) - some of them are RED footage, and others came directly from our f/x guy. We are going into a color correction session in a post house and we've been asked to provide a sequential 16 bit TIFF image sequence of the edited time line.
    I need to do a cross dissolve b/w most of the clips I have. I have created image sequence QT movie (reference files) from the TIFF images. Though they play fine in QT player, when I try importing into FCP, I am met with a "general error". I tried both dragging it into QT, as well as File --> Import.
    I am wondering what can I do to get these clips into FCP in order to apply the cross dissolve transitions I need. Is this a problem relating to the 16bit nature of the TIFF files?
    I tried exporting the TIFF image sequence standalone QT movie, and those imported fine. However, I have a feeling that the standalone movie conversion also decrease my bit depth from 16 to 8. (When I do my final TIFF output from FCP after dissolves / transitions had been applied, each TIFF file is now 8 MB instead of 12 MB, hence my suspicion that the bit depth is adjusted).
    Are there any settings I am missing, or does FCP simply don't support 16 bit image sequence reference file. As a test, I had also converted all my TIFF to jpg, and created jpeg image sequence reference file. These reference QT file can be successfully imported to FCP and I can edit them as if they are a clip.
    If FCP is not able to handle these files, what are my other options? After Effects?
    Any help is appreciated.
    Thank you.
    Michael
    <Edited by Moderator>

    As far as I know, both FCP and Color only support up to 10 bit color, which is 1024 levels for each color channel, more than enough for avoiding color banding.
    If you need 16 bit for sure, I believe AE will support 16 bit output. Another 16 bit application would be the extended version of Photoshop, which has some limited time line capability.

  • Error encountered while reading TIFF image, Image may be damaged of incompatible. Resave the image w

    I am currently running CS3, windows XP, service pack 2, with recent update, 5.03 installed today.
    I just opened a 500 page document not in sections where 90% of the document is a placed PDF.
    The PDFS were placed using a sample Script that came with Indesign, that instructs the PDF to automatically flow each page after another.
    When scrolling through quickly in the pages pallette, I get the follwing error:-
    "Error encountered while reading TIFF image, Image may be damaged of incompatible. Resave the image with different settings and try again."
    I click OK.
    Then I get the following error.....
    " Could not complete request because of database error. The File "ABC.indd" is damaged (Error Code: 3).
    Click OK....
    Then I get the following error....
    Adobe Indesign is shutting down. A serious error was detected. Please restart Indesign to recover work in any unsaved Indesign documents.
    Then I get the error.......
    Indesign.exe has encountered a problem and needs to close. We are sorry for any inconveneince.
    And I have two buttons to click....
    Debug or Close.....
    If I click Debug, it closes Indesign.
    Within this window there is also a window to gather further information....I click it and it tells me...
    "Indesign.exe....Error Signature AppName: indesign.exe AppVer: 5.0.3.662
    ModName: public.dll ModVer: 5.0.3.662 Offset: 0002e19a"
    To view technical inforamtion about the error report, clikc here....
    "Then it creates an error report and tells me where the report is located along with a scrollable window of 0xc0000005 and heap of zeros."
    The report conatains a whole heap of CHECKSUM ERRORS.
    CAN ANYONE PLEASE HELP??
    I had these errors before updating to 5.03 and the patch hasn't rectified anything!!

    Open the .inx file in CS3 (that's what you have, right?) and save as a new .indd.
    I'd also be tempted to open the tiff in Photoshop and do a save as to re-write it.
    Let us know if it helps.
    Storing files on the network leaves you more open tot he risk of file damage during transfer and save operations.
    Peter

  • Displaying TIFF images in Oracle Forms 6i

    Hello, friends!
    I am working in Oracle Forms 6.0.8 (that ancient tool) and encounter a problem with displaying TIFF images.
    I have a number of scanned images and some of them are displayed and some are not. I've tried both extracting them from the database or from the file system (using READ_IMAGE_FILE). Sometimes I am getting just blank field in my image item and sometimes (after using READ_IMAGE_FILE) I get the error FRM-47100 (cannot read image file). Of course I've checked that all the files are displayed using standard tools for displaying TIFFs.
    Basically the question is what kind of TIFF is considered valid and readable by Oracle Forms.
    Analyzing TIFF tags actually gave me nothing: I have a pair of files with tags different only in image width/length and a number of rows/strip (but even those values are close), and one of the file is displayed correctly while the other is not. The thing I noticed is that invalid files are using compression type of CCITT Group 4.
    Possibly Oracle Forms follows TIFF specification only to certain extent and does not support all the extensions, while sometimes the problems are not visible to user.
    As a result of my work I need some automatic tool that converts undisplayable TIFF files to displayable ones but firstly I am to determine where the problem is. And it would be very good to have a prooflink that approves my decision.
    Looking forward to any help! Thanks in advance.

    Thanks to everybody, but I'm afraid my files don't contain any EXIF tags (although TIFF seems to support them). The file doesn't contain any tags with IDs greater than 0x7FFF but only core TIFF tags (with IDs of lower numbers). Moreover I have a file with exactly the same set of tags (but the values are a bit different) which is displayed properly.
    I've shared the issued file (nondisplayable) on the following link: [https://rapidshare.com/files/3137807470/2.tif]
    If anyone could tell me why isn't it displayed in Forms I would be very grateful.

Maybe you are looking for

  • Attaching a Mail message to an iCal event?

    When I put a new event on a calendar day, I like to drag the relevant email to that event. And it works. The problem is with the dragging process. it's very awkward. When constructing the event it offers options to add a url or a file. But the email

  • Runtime error in Web Dynpro Application

    Hi Experts, I am getting a runtime error from a custom Web dynpro Application. The error details are Category               ABAP Programming Error Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED_NO Except.                CX_SY_REF_IS_INITIAL Web D

  • Function Module for fnding all employees under an Org Unit

    Hi, Is there any Function module to find the employees of an ORG Unit . I need to specify the Org unit Name and get the employees out of it . I looked at the FM HRCM_ORGUNIT_EMPLOYEE_LIST_GET . It has import parameters as OTYP OBJID PATH_ID What valu

  • BEA Weblogic 9.0/Open LDAP communication

    We have BEA Weblogic 9.0 and OpenLDAP running on two different machines. I am running a stress/load/performance test on my app and found that there are repetitive calls between Weblogic and OpenLDAP, even though I have configured caching thru Weblogi

  • HELP WITH TRANSFERING FILES BY JAVA

    Hi everybody! I'm making a chat with java (Sever and Client) using socket. I'd like to know how could I transfer files in binary from this chat. Could anyone help me?? Thanks in advance!