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

Function ilSaveJpeg

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

Writes a Jpeg file

Source from the content-addressed store, hash-verified

426
427//! Writes a Jpeg file
428ILboolean ilSaveJpeg(const ILstring FileName)
429{
430 ILHANDLE JpegFile;
431 ILuint JpegSize;
432
433 if (ilGetBoolean(IL_FILE_MODE) == IL_FALSE) {
434 if (iFileExists(FileName)) {
435 ilSetError(IL_FILE_ALREADY_EXISTS);
436 return IL_FALSE;
437 }
438 }
439
440 JpegFile = iopenw(FileName);
441 if (JpegFile == NULL) {
442 ilSetError(IL_COULD_NOT_OPEN_FILE);
443 return IL_FALSE;
444 }
445
446 JpegSize = ilSaveJpegF(JpegFile);
447 iclosew(JpegFile);
448
449 if (JpegSize == 0)
450 return IL_FALSE;
451 return IL_TRUE;
452}
453
454
455//! Writes a Jpeg to an already-opened file

Callers 3

ILAPIENTRY ilSaveFunction · 0.85
ILAPIENTRY ilSaveImageFunction · 0.85
NewTestFunction · 0.85

Calls 4

iFileExistsFunction · 0.85
ilSetErrorFunction · 0.85
ilSaveJpegFFunction · 0.85
iSaveJpegInternalFunction · 0.85

Tested by 1

NewTestFunction · 0.68