TIFF and LibTiff Mail List Archive

2011.04.22 20:24 "[Tiff] Question regarding toggling associated to unspecified", by Billy G. Alexander

I'm currently working on a old photogrammetric package that is using libtiff v3.9.0 however our client is requesting that we toggle the associated alpha tag 338 1 to 0 for compatibility with certain other software they have.

Is anyone familiar with a command line parameter or filter that has been implemented to toggle associated_alpha to Unspecified 1 to 0 during a batch routine for thousands of tif images....

I am new to this entire process I'm a little sketchy.

I welcome comments suggestions and direction...

If not does anyone foresee any issues if I was to implement the following in my extract.c that calls littiff. I realise i probably haven't provided you with enough information as yet but hopefully someone will see my intent and direction
By doing this i am hoping to implement a command line parameter in my script file.

 /* Typedef statements */

/* Struct, union, and enum definitions */

/* Static declarations */
static char
 routine_name[] = "tif_toggle_alpha";

/* Auto declarations */
 ii; /* Generic counter */



   *tifb;                       /* TIF data buffer */

/* Verify the image format */

/* Set the messages handlers */

/* Open the TIFF file for writing. */
tifb = TIFFOpen(pathname, "w");
if(tifb == NULL)
  sprintf(msg_buff, "Unable to open TIFF file!\n [file: %s]\n", pathname);

/* Update TIFF IFD. */

/* Output the TIFF image. */
for(ii = 0; ii < (int_4)dt->ny; ii++)
  idx = (u_char *)dt->pix2 + ( ii * dt->nx);
  if(TIFFWriteScanline(tifb, idx, ii, 0) < 0)
    TIF_LOG_ERR("Failed to write TIFF scanline.\n");

/* Close the TIFF file. */

  return( ASI_STATUS_SUC);