MCPcopy Create free account
hub / github.com/creatale/node-dv / pixcompWriteFile

Function pixcompWriteFile

deps/leptonica/src/pixcomp.c:2414–2429  ·  view source on GitHub ↗

! * \brief pixcompWriteFile() * * \param[in] rootname * \param[in] pixc * \return 0 if OK, 1 on error * * * Notes: * (1) The compressed data is written to file, and the filename is * generated by appending the format extension to %rootname. * */

Source from the content-addressed store, hash-verified

2412 * </pre>
2413 */
2414l_int32
2415pixcompWriteFile(const char *rootname,
2416 PIXC *pixc)
2417{
2418char buf[128];
2419
2420 PROCNAME("pixcompWriteFile");
2421
2422 if (!pixc)
2423 return ERROR_INT("pixc not defined", procName, 1);
2424
2425 snprintf(buf, sizeof(buf), "%s.%s", rootname,
2426 ImageFileFormatExtensions[pixc->comptype]);
2427 l_binaryWrite(buf, "w", pixc->data, pixc->size);
2428 return 0;
2429}
2430
2431

Callers 1

pixacompWriteFilesFunction · 0.85

Calls 1

l_binaryWriteFunction · 0.85

Tested by

no test coverage detected