Krita Source Code Documentation
Loading...
Searching...
No Matches
HeifError.cpp File Reference
#include "HeifError.h"

Go to the source code of this file.

Functions

KisImportExportErrorCode setHeifError (KisDocument *document, heif::Error error)
 

Function Documentation

◆ setHeifError()

KisImportExportErrorCode setHeifError ( KisDocument * document,
heif::Error error )

Definition at line 10 of file HeifError.cpp.

12{
13 switch (error.get_code()) {
14 case heif_error_Ok:
16
17 case heif_error_Input_does_not_exist:
18 // this should never happen because we do not read from file names
21
22 case heif_error_Invalid_input:
23 case heif_error_Decoder_plugin_error:
25
26 case heif_error_Unsupported_filetype:
27 case heif_error_Unsupported_feature:
29
30 case heif_error_Usage_error:
31 case heif_error_Encoder_plugin_error:
32 // this should never happen if we use libheif in the correct way
35
36 case heif_error_Memory_allocation_error:
37 document->setErrorMessage(i18n("Could not allocate memory."));
39
40 case heif_error_Encoding_error:
41 document->setErrorMessage(i18n("Could not encode or write image."));
43
44 case heif_error_Color_profile_does_not_exist:
45 document->setErrorMessage(i18n("Color profile was not found in the document."));
47 default:
48 // we only get here when we forgot to handle an error ID
49 document->setErrorMessage(QString(i18n("Unknown error: %1")).arg(QString::fromStdString(error.get_message())));
51 }
52}
#define KIS_ASSERT_RECOVER_RETURN_VALUE(cond, val)
Definition kis_assert.h:85

References ImportExportCodes::Failure, ImportExportCodes::FileFormatIncorrect, ImportExportCodes::FormatFeaturesUnsupported, ImportExportCodes::InsufficientMemory, ImportExportCodes::InternalError, KIS_ASSERT_RECOVER_RETURN_VALUE, ImportExportCodes::NoAccessToWrite, and ImportExportCodes::OK.