Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
b1b1777a
Commit
b1b1777a
authored
Nov 13, 2022
by
Volker Krause
Browse files
Look up image masks for loading
parent
cbd3f8dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/pdf/pdfimage.cpp
View file @
b1b1777a
...
...
@@ -138,8 +138,26 @@ QImage PdfImagePrivate::load()
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(0, 69, 0)
const
auto
xref
=
m_page
->
m_doc
->
m_popplerDoc
->
getXRef
();
const
auto
obj
=
xref
->
fetch
(
refNum
(),
refGen
());
return
load
(
obj
.
getStream
(),
m_colorMap
.
get
());
switch
(
m_ref
.
m_type
)
{
case
PdfImageType
::
Image
:
return
load
(
obj
.
getStream
(),
m_colorMap
.
get
());
case
PdfImageType
::
Mask
:
{
const
auto
dict
=
obj
.
getStream
()
->
getDict
();
const
auto
maskObj
=
dict
->
lookup
(
"Mask"
);
return
load
(
maskObj
.
getStream
(),
m_colorMap
.
get
());
}
case
PdfImageType
::
SMask
:
return
{};
// TODO
}
return
{};
#else
if
(
m_ref
.
m_type
!=
PdfImageType
::
Image
)
{
return
{};
}
std
::
unique_ptr
<
ImageLoaderOutputDevice
>
device
(
new
ImageLoaderOutputDevice
(
this
));
m_page
->
m_doc
->
m_popplerDoc
->
displayPageSlice
(
device
.
get
(),
m_page
->
m_pageNum
+
1
,
72
,
72
,
0
,
false
,
true
,
false
,
-
1
,
-
1
,
-
1
,
-
1
);
return
device
->
image
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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