PICTools Programmer's Reference
OP_TIFEDIT

OP_TIFEDIT: Edit TIFF Tags and File Contents

The purpose of OP_TIFEDIT is to assemble a common set of TIFF file tag editing and contents editing routines into a simple low level interface scheme for general availability. The requirement to insert, replace, delete, and edit TIFF tags in any of a TIFF file's pages along with the ability to insert, extract, replace, and delete any page in a TIFF file are common requirements in many imaging systems.

The TIFF_EDIT:OP_TIFEDIT section of PIC_PARM describes the details of the structure tused to control OP_TIFEDIT's actions. The following table outlines the current feature set of OP_TIFEDIT.

 

TIFFReq_Op

Operation

TF_DELETE_PAGE

Delete one or more TIFF IFD pages.

TF_INSERT_PAGE

Insert one or more TIFF IFD pages.

TF_REPLACE_PAGE

Replace an existing TIFF IFD page.

TF_EXTRACT_PAGE

Extract a designated IFD page.

TF_COMPACT

Remove all unused space from a Tiff stream.

TF_EDIT_TAGS

Acquire, edit and set the Tiff Tags.

 

Delete a TIFF IFD Page

The deleted pages do not compact the Tiff file with this operation. If the requested pages do not exist, an error is returned.

Insert a TIFF IFD Page

The destination Tiff file will increase by the size of the inserted pages. If one of the source pages does not exist, an error is returned. If the designated destination Page does not exist, the inserted page will be appended to the end of the destination Tiff File

Replace a TIFF IFD Page

The destination Tiff file will increase by the size of the inserted page. If either the source or destination page do not exist an error is returned.

Extract a TIFF IFD Page

The Put queue will contain the desired page as a single page TIFF file.

Compact TIFF File

The Tiff source stream will be read from the Get Queue and placed in the Put Queue discarding wasted unused space acquired from the other Tiff Edit operations.

Acquire, Edit, and Set the Tiff Tags

The Tiff source file will be read from the Get Queue upon the REQ_INIT request cycle and a PIC2List will be retuned on the corresponding (first) RES_DONE  response. The user edits, adds, and deletes the Tiff Tag list as desired prior to REQ_EXEC phase.  When the REQ_EXEC phase is executed, the PIC2List is added appropriately to the output Put Queue stream. The Tags read and written will belong to the specified IFD page in Get_Page. The tags (actually the IFD) will be added to the end of the Put Queue stream, hence enlarging the Tiff stream. This command is a bit tricky that the input file should be opened for read and the same file (or a copy) opened for read/write. The read only file is in the get queue and the read/write file in the put queue.

The following Tags cannot be viewed or changed:

TAG_StripByteCounts:

            TAG_StripOffsets:

            TAG_JPEGProc:

            TAG_JPEGInterchangeFormat:

            TAG_JPEGInterchangeFormatLength:

            TAG_JPEGRestartInterval:

            TAG_JPEGLosslessPredictors:

            TAG_JPEGPointTransforms:

            TAG_JPEGQTables:

            TAG_JPEGDCTables:

            TAG_JPEGACTables:

The following Tags can be viewed but not changed:

            TAG_RowsPerStrip:

            TAG_SamplesPerPixel:

            TAG_ImageWidth:

            TAG_ImageLength:

            TAG_Compression:

            TAG_T4Options:

            TAG_T6Options:

            TAG_YCbCrSubSampling:

            TAG_BitsPerSample:

            TAG_PhotometricInterpretation:

Limitations:

Tiled Tiff files will not be supported at this time.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback