Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Okular
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
36
Merge Requests
36
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Graphics
Okular
Commits
4b2ba6a7
Commit
4b2ba6a7
authored
Nov 14, 2017
by
Alexander Trufanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to display a malformed image if feasible
Differential Revision:
https://phabricator.kde.org/D8415
parent
43cd93a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
generators/kimgio/generator_kimgio.cpp
generators/kimgio/generator_kimgio.cpp
+6
-2
No files found.
generators/kimgio/generator_kimgio.cpp
View file @
4b2ba6a7
...
...
@@ -69,8 +69,12 @@ bool KIMGIOGenerator::loadDocumentInternal(const QByteArray & fileData, const QS
QImageReader
reader
(
&
buffer
,
QImageReader
::
imageFormat
(
&
buffer
)
);
reader
.
setAutoDetectImageFormat
(
true
);
if
(
!
reader
.
read
(
&
m_img
)
)
{
emit
error
(
i18n
(
"Unable to load document: %1"
,
reader
.
errorString
()
),
-
1
);
return
false
;
if
(
!
m_img
.
isNull
())
{
emit
warning
(
i18n
(
"This document appears malformed. Here is a best approximation of the document's intended appearance."
),
-
1
);
}
else
{
emit
error
(
i18n
(
"Unable to load document: %1"
,
reader
.
errorString
()
),
-
1
);
return
false
;
}
}
QMimeDatabase
db
;
auto
mime
=
db
.
mimeTypeForFileNameAndData
(
fileName
,
fileData
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment