Krita Source Code Documentation
Loading...
Searching...
No Matches
HeifError.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Dirk Farin <farin@struktur.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include "HeifError.h"
8
9
11 heif::Error error)
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}
KisImportExportErrorCode setHeifError(KisDocument *document, heif::Error error)
Definition HeifError.cpp:10
#define KIS_ASSERT_RECOVER_RETURN_VALUE(cond, val)
Definition kis_assert.h:85