Ticket #34408: molmol-png.diff

File molmol-png.diff, 903 bytes (added by howarth@…, 12 years ago)

update molmol png support

  • src/motogl/MotOGLDump.c

    old new  
    248248pngErrHand(png_structp pngStrucP, char *errMsg)
    249249{
    250250  IORaiseError(errMsg);
    251   longjmp(pngStrucP->jmpbuf, 1);
     251  longjmp(png_jmpbuf(pngStrucP), 1);
    252252}
    253253#endif
    254254
     
    357357      return IO_RES_ERR;
    358358    }
    359359
    360     if (setjmp(pngStrucP->jmpbuf)) {
     360    if (setjmp(png_jmpbuf(pngStrucP))) {
    361361      if (cBuf != NULL)
    362362        free(cBuf);
    363363      if (fBuf != NULL)
     
    368368
    369369    png_init_io(pngStrucP, ImgFileP);
    370370
    371     pngInfoP->width = imgW;
    372     pngInfoP->height = imgH;
    373     pngInfoP->bit_depth = 8;
    374     pngInfoP->color_type = PNG_COLOR_TYPE_RGB;
     371    png_set_IHDR(pngStrucP, pngInfoP, imgW, imgH, 8, PNG_COLOR_TYPE_RGB, 0, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
    375372    png_write_info(pngStrucP, pngInfoP);
    376373  }
    377374#endif