Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.flexdbserver.services.asset
Class FPOExtract  view FPOExtract download FPOExtract.java

java.lang.Object
  extended bycom.flexstor.flexdbserver.services.asset.FPOExtract

public class FPOExtract
extends java.lang.Object

Locate and extract the image from a Xinet EPSF


Field Summary
protected  boolean bError
           
protected  boolean bTest
          TEST MODE
static java.lang.String IDENTIFIER
           
protected  int nAdditionalItems
           
protected  long nFilesize
           
protected  int nImageHeight
           
protected  int nImageLength
           
protected  int nImageWidth
           
protected  int nImageXResolution
           
protected  int nImageYResolution
           
protected  java.lang.String sImageSubType
           
protected  java.lang.String sImageType
           
protected  java.lang.String sOutputFile
           
 
Constructor Summary
FPOExtract()
           
 
Method Summary
protected  boolean checkFormat(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)
           
protected  boolean closeFile(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)
           
protected  boolean copyBytes(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFrom, com.flexstor.common.io.xfile.FlexXRandomAccessFile fTo, int nCount)
           
protected  boolean extractAndCopyImage(com.flexstor.common.io.xfile.FlexXRandomAccessFile fParent, long nFilePos, int nImageLength, java.lang.String sThumbnailFile, boolean bDonotWrite)
           
 boolean extractImage(java.lang.String sParentFile, java.lang.String sOutputFile, java.lang.String sImageToProcess)
           
 boolean extractImage(java.lang.String sParentFile, java.lang.String sOutputFile, java.lang.String sImageToProcess, java.lang.String sImageName)
           
protected  int findTag(byte[] anIFDBuffer, int nTagCount, int nTag)
          Returns the index into the buffer of the specified tag Return -1 if tag not found
protected  long getCurrentPos(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)
           
protected  boolean getEpsInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)
           
 long getFilesize()
           
protected  boolean getGifInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)
           
 int getHeight()
           
 boolean getImageInfo(java.lang.String sParentFile, java.lang.String sImageToProcess)
           
 boolean getImageInfo(java.lang.String sParentFile, java.lang.String sImageToProcess, java.lang.String sImageName)
           
protected  long getImagePointer(com.flexstor.common.io.xfile.FlexXRandomAccessFile fParentFile, java.util.Vector vMap, java.lang.String sName, java.lang.String sImageToProcess)
          Get the location of the image specified by type (FPO, etc) and sequence number (1,2..) Non-image blocks may be interspersed between the image blocks so must check the block format to make sure that it is an image block.
protected  boolean getInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile, long nBlockStartPos)
           
 int getInt(byte[] anData, int nStartIndex, int nCount)
           
protected  int getInt(byte bHi, byte bLo)
           
protected  int getInt(java.lang.String sNumber)
           
protected  boolean getJfifInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile, long nBlockStartPos)
           
 java.util.Vector getMap(com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile)
           
 boolean getMapInfo(java.lang.String sParentFile)
           
protected  boolean getPictInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile, long nBlockStartPos, int nPictVersion)
           
protected  java.lang.String getSubString(java.lang.String sInput, int nStart, int nEnd)
           
protected  boolean getTiffInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile)
           
protected  int getTiffResolution(byte[] anIFD, com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile, long lCurrentPos, int nTag, int nTagCount, int nResolutionUnit)
           
 java.lang.String getType()
           
 int getWidth()
           
 int getXResolution()
           
 int getYResolution()
           
protected  boolean goToFileLocation(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile, long nFilePos)
          Seek to offset from beginning of file
protected  boolean goToPointerLocation(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile, int nOffset)
          Seek to the specified offset from the current file position
protected  com.flexstor.common.io.xfile.FlexXRandomAccessFile openFile(java.lang.String sName, java.lang.String sMode)
           
protected  void printDiagnosticMessage(java.lang.String sMsg)
           
protected  void printMap(java.util.Vector vMap)
           
protected  boolean processImages(java.lang.String sParentFile, java.lang.String sOutputFile, java.lang.String sName, java.lang.String sImageToProcess, boolean bInfo)
           
protected  byte[] readBytes(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile, int nCount)
           
protected  int readInt(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)
          Reads the 4-byte integer at the current file location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER

public static final java.lang.String IDENTIFIER
See Also:
Constant Field Values

sOutputFile

protected java.lang.String sOutputFile

nImageWidth

protected int nImageWidth

nImageHeight

protected int nImageHeight

nImageXResolution

protected int nImageXResolution

nImageYResolution

protected int nImageYResolution

nFilesize

protected long nFilesize

nImageLength

protected int nImageLength

sImageType

protected java.lang.String sImageType

sImageSubType

protected java.lang.String sImageSubType

nAdditionalItems

protected int nAdditionalItems

bError

protected boolean bError

bTest

protected boolean bTest
TEST MODE

Constructor Detail

FPOExtract

public FPOExtract()
Method Detail

extractImage

public boolean extractImage(java.lang.String sParentFile,
                            java.lang.String sOutputFile,
                            java.lang.String sImageToProcess)

extractImage

public boolean extractImage(java.lang.String sParentFile,
                            java.lang.String sOutputFile,
                            java.lang.String sImageToProcess,
                            java.lang.String sImageName)

getImageInfo

public boolean getImageInfo(java.lang.String sParentFile,
                            java.lang.String sImageToProcess)

getImageInfo

public boolean getImageInfo(java.lang.String sParentFile,
                            java.lang.String sImageToProcess,
                            java.lang.String sImageName)

getMapInfo

public boolean getMapInfo(java.lang.String sParentFile)

processImages

protected boolean processImages(java.lang.String sParentFile,
                                java.lang.String sOutputFile,
                                java.lang.String sName,
                                java.lang.String sImageToProcess,
                                boolean bInfo)

getImagePointer

protected long getImagePointer(com.flexstor.common.io.xfile.FlexXRandomAccessFile fParentFile,
                               java.util.Vector vMap,
                               java.lang.String sName,
                               java.lang.String sImageToProcess)
Get the location of the image specified by type (FPO, etc) and sequence number (1,2..) Non-image blocks may be interspersed between the image blocks so must check the block format to make sure that it is an image block. The image format is remembered for later info extraction.


getInfo

protected boolean getInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile,
                          long nBlockStartPos)

getEpsInfo

protected boolean getEpsInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)

getGifInfo

protected boolean getGifInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)

getPictInfo

protected boolean getPictInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile,
                              long nBlockStartPos,
                              int nPictVersion)

getTiffInfo

protected boolean getTiffInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile)

findTag

protected int findTag(byte[] anIFDBuffer,
                      int nTagCount,
                      int nTag)
Returns the index into the buffer of the specified tag Return -1 if tag not found


getTiffResolution

protected int getTiffResolution(byte[] anIFD,
                                com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile,
                                long lCurrentPos,
                                int nTag,
                                int nTagCount,
                                int nResolutionUnit)

getJfifInfo

protected boolean getJfifInfo(com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile,
                              long nBlockStartPos)

getInt

protected int getInt(byte bHi,
                     byte bLo)

getSubString

protected java.lang.String getSubString(java.lang.String sInput,
                                        int nStart,
                                        int nEnd)

getInt

protected int getInt(java.lang.String sNumber)

openFile

protected com.flexstor.common.io.xfile.FlexXRandomAccessFile openFile(java.lang.String sName,
                                                                      java.lang.String sMode)

readInt

protected int readInt(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)
Reads the 4-byte integer at the current file location


goToPointerLocation

protected boolean goToPointerLocation(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile,
                                      int nOffset)
Seek to the specified offset from the current file position


checkFormat

protected boolean checkFormat(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)

readBytes

protected byte[] readBytes(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile,
                           int nCount)

getCurrentPos

protected long getCurrentPos(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)

extractAndCopyImage

protected boolean extractAndCopyImage(com.flexstor.common.io.xfile.FlexXRandomAccessFile fParent,
                                      long nFilePos,
                                      int nImageLength,
                                      java.lang.String sThumbnailFile,
                                      boolean bDonotWrite)

goToFileLocation

protected boolean goToFileLocation(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile,
                                   long nFilePos)
Seek to offset from beginning of file


copyBytes

protected boolean copyBytes(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFrom,
                            com.flexstor.common.io.xfile.FlexXRandomAccessFile fTo,
                            int nCount)

closeFile

protected boolean closeFile(com.flexstor.common.io.xfile.FlexXRandomAccessFile fFile)

getMap

public java.util.Vector getMap(com.flexstor.common.io.xfile.FlexXRandomAccessFile fInputFile)

getInt

public int getInt(byte[] anData,
                  int nStartIndex,
                  int nCount)

printMap

protected void printMap(java.util.Vector vMap)

getWidth

public int getWidth()

getHeight

public int getHeight()

getXResolution

public int getXResolution()

getYResolution

public int getYResolution()

getFilesize

public long getFilesize()

getType

public java.lang.String getType()

printDiagnosticMessage

protected void printDiagnosticMessage(java.lang.String sMsg)