MCPcopy Create free account
hub / github.com/DentonW/DevIL / iLoadJpegInternal

Function iLoadJpegInternal

DevIL/src-IL/src/il_jpeg.cpp:320–358  ·  view source on GitHub ↗

Internal function used to load the jpeg.

Source from the content-addressed store, hash-verified

318
319// Internal function used to load the jpeg.
320ILboolean iLoadJpegInternal()
321{
322 struct jpeg_error_mgr Error;
323 struct jpeg_decompress_struct JpegInfo;
324 ILboolean result;
325
326 if (iCurImage == NULL) {
327 ilSetError(IL_ILLEGAL_OPERATION);
328 return IL_FALSE;
329 }
330
331 JpegInfo.err = jpeg_std_error(&Error); // init standard error handlers
332 Error.error_exit = iJpegErrorExit; // add our exit handler
333 Error.output_message = OutputMsg;
334
335 if ((result = setjmp(JpegJumpBuffer) == 0) != IL_FALSE) {
336 jpeg_create_decompress(&JpegInfo);
337 JpegInfo.do_block_smoothing = IL_TRUE;
338 JpegInfo.do_fancy_upsampling = IL_TRUE;
339
340 //jpeg_stdio_src(&JpegInfo, iGetFile());
341
342 devil_jpeg_read_init(&JpegInfo);
343 jpeg_read_header(&JpegInfo, IL_TRUE);
344
345 result = ilLoadFromJpegStruct(&JpegInfo);
346
347 jpeg_finish_decompress(&JpegInfo);
348 jpeg_destroy_decompress(&JpegInfo);
349
350 }
351 else
352 {
353 jpeg_destroy_decompress(&JpegInfo);
354 }
355
356 //return ilFixImage(); // No need to call it again (called first in ilLoadFromJpegStruct).
357 return result;
358}
359
360
361

Callers 4

iLoadMp3InternalFunction · 0.85
ilLoadJpegFFunction · 0.85
ilLoadJpegLFunction · 0.85
ilLoadJpegFunction · 0.85

Calls 4

ilSetErrorFunction · 0.85
devil_jpeg_read_initFunction · 0.85
ilLoadFromJpegStructFunction · 0.85
ilFixImageFunction · 0.85

Tested by

no test coverage detected