diff --git a/backend_mitsu.c b/backend_mitsu.c index bcc8cfa..7e9c6da 100644 --- a/backend_mitsu.c +++ b/backend_mitsu.c @@ -31,6 +31,8 @@ int mitsu_loadlib(struct mitsu_lib *lib, int type) { DL_INIT(); + memset(lib, 0, sizeof(*lib)); + #if defined(WITH_DYNAMIC) DEBUG("Attempting to load image processing library\n"); lib->dl_handle = DL_OPEN(LIB_NAME_RE); @@ -51,7 +53,6 @@ int mitsu_loadlib(struct mitsu_lib *lib, int type) return CUPS_BACKEND_FAILED; } - lib->Get3DColorTable = DL_SYM(lib->dl_handle, "CColorConv3D_Get3DColorTable"); lib->Load3DColorTable = DL_SYM(lib->dl_handle, "CColorConv3D_Load3DColorTable"); lib->Destroy3DColorTable = DL_SYM(lib->dl_handle, "CColorConv3D_Destroy3DColorTable"); lib->DoColorConv = DL_SYM(lib->dl_handle, "CColorConv3D_DoColorConv"); @@ -61,7 +62,7 @@ int mitsu_loadlib(struct mitsu_lib *lib, int type) lib->DoImageEffect70 = DL_SYM(lib->dl_handle, "do_image_effect70"); lib->DoImageEffect80 = DL_SYM(lib->dl_handle, "do_image_effect80"); lib->SendImageData = DL_SYM(lib->dl_handle, "send_image_data"); - if (!lib->Get3DColorTable || !lib->Load3DColorTable || + if (!lib->Load3DColorTable || !lib->Destroy3DColorTable || !lib->DoColorConv || !lib->GetCPCData || !lib->DestroyCPCData || !lib->DoImageEffect60 || !lib->DoImageEffect70 || @@ -133,10 +134,8 @@ int mitsu_apply3dlut(struct mitsu_lib *lib, char *lutfname, uint8_t *databuf, ERROR("Memory allocation failure!\n"); return CUPS_BACKEND_RETRY_CURRENT; } - if ((i = lib->Get3DColorTable(buf, lutfname))) { - ERROR("Unable to open LUT file '%s' (%d)\n", lutfname, i); - return CUPS_BACKEND_CANCEL; - } + if ((i = dyesub_read_file(lutfname, buf, LUT_LEN, NULL))) + return i; lib->lut = lib->Load3DColorTable(buf); free(buf); if (!lib->lut) { diff --git a/backend_mitsu.h b/backend_mitsu.h index 95e401e..e69383d 100644 --- a/backend_mitsu.h +++ b/backend_mitsu.h @@ -61,7 +61,6 @@ typedef int (*send_image_dataFN)(struct BandImage *out, void *context, struct mitsu_lib { void *dl_handle; lib70x_getapiversionFN GetAPIVersion; - Get3DColorTableFN Get3DColorTable; Load3DColorTableFN Load3DColorTable; Destroy3DColorTableFN Destroy3DColorTable; DoColorConvFN DoColorConv; diff --git a/backend_mitsu70x.c b/backend_mitsu70x.c index a0450fe..52476cc 100644 --- a/backend_mitsu70x.c +++ b/backend_mitsu70x.c @@ -1157,7 +1157,7 @@ repeat: /* Run through basic LUT, if present and enabled */ if (job->lutfname) { int ret = mitsu_apply3dlut(&ctx->lib, job->lutfname, - job->databuf, job->cols, + job->spoolbuf, job->cols, job->rows, job->cols * 3, COLORCONV_BGR); if (ret) {