AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

2002.11.04 13:35 "", by Diana Szleper

Hi,

I'm trying to change the defqult value of the pseudo tag TIFFTAG_ZIPQUALITY. I use TIFFSetField(tif, TIFFTAG_ZIPQUALITY, 50).

It seem to be without effect.

In the following function sp->state = 0... I never call deflateParams.

static int
ZIPVSetField(TIFF* tif, ttag_t tag, va_list ap)
{
      ZIPState* sp = ZState(tif);
     static const char module[] = "ZIPVSetField";

    switch (tag) {
  case TIFFTAG_ZIPQUALITY:
                sp->zipquality = va_arg(ap, int);
               if (tif->tif_mode != O_RDONLY && (sp->state&ZSTATE_INIT)) {
                     if (deflateParams(&sp->stream,
                      sp->zipquality, Z_DEFAULT_STRATEGY) != Z_OK) {
                              TIFFError(module, "%s: zlib error: %s",
                             tif->tif_name, sp->stream.msg);
                             return (0);
                     }
               }
               return (1);
     default:
                return (*sp->vsetparent)(tif, tag, ap);
 }
       /*NOTREACHED*/
}

if someone can show me the way to do it...

thanks

diana