To save an image to a file in DevIL

For a long time they try to save a texture to a file using DevIL library, but a file called 1x1. Here’s the code:

ILuint SaveTexture(ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type,
ILenum TypeS, ILenum Mode, char * FileName, ILuint Texture)
{
//////////////////////////////
// Width
// * Specifies the new image width. This cannot be 0.
// Height
// * Specifies the new image height. This cannot be 0.
// Depth
// * Specifies the new image depth. Anything greater than 1 will make the image 3d. This cannot be 0.
// Bpp
// * The bytes per pixel of the image data. Do not confuse this with bits
// per pixel, which is also commonly used. Common bytes per pixel
// values are 1, 3 and 4.
// Format,
// * The format of the image data. Formats accepted are listed here and are self-explanatory:
// - IL_COLOUR_INDEX
// - IL_RGB
// - IL_RGBA
// - IL_BGR
// - IL_BGRA
// - IL_LUMINANCE
// Type
// * The type of image data. Usually, this will be IL_UNSIGNED_BYTE,
//unless you want to utilize multiple bits per colour channel.
//Type accepted are listed here:
// - IL_BYTE
// - IL_UNSIGNED_BYTE
// - IL_SHORT
// - IL_UNSIGNED_SHORT
// - IL_INT
// - IL_UNSIGNED_INT
// - IL_FLOAT
// - IL_DOUBLE
// TypeS-aved-image
// * IL_BMP - Save the image as a Microsoft bitmap (.bmp).
// * IL_JPG - Save the image as a Jpeg (.jpg, .jpeg).
// * IL_PNG - Save the image as a Portable Network Graphics (.png) image.
// * IL_TGA - Save the image as a TrueVision Targa.
// Mode
// * IL_FILE_OVERWRITE - Possible to override.
// * IL_FILE_ALREADY_EXISTS - Impossible to override.
// FileName
// * The filename of the file to save to.
// Texture
// * Texture to the save.
//////////////////////////////

// włączenie parametru Mode
ilEnable(Mode);

ilGenImages(1, &Texture);

// wybranie biezacego obrazu
ilBindImage(Texture);

if(Width == Deflaut)Width = ilGetInteger(IL_IMAGE_WIDTH);
if(Height == Deflaut)Height = ilGetInteger(IL_IMAGE_HEIGHT);
if(Bpp == Deflaut)Bpp = ilGetInteger(IL_IMAGE_BYTES_PER_PIXEL);
if(Format == Deflaut)Format = ilGetInteger(IL_IMAGE_FORMAT);
if(Type == Deflaut)Type = ilGetInteger(IL_IMAGE_TYPE);

ilTexImage(Width, Height, Depth, Bpp, Format, Type, ilGetData() /*Texture*/);

// zapisanie obrazu
ilSave(TypeS, FileName);

// wyłączenie parametru Mode
ilDisable(Mode);

if(ilGetError() != IL_NO_ERROR)return ilGetError();

return IL_NO_ERROR;

}