summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-05 15:16:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-05 15:16:37 +0000
commit1330ebbff8a31beb19d38b2a680625a19240a4f0 (patch)
tree2699dde2f80b46527b5dd40184efe3ac927529fa /core/fpdfapi/render
parent40482e6f06eac0c5089e44df2d62881127eeeb3e (diff)
downloadpdfium-1330ebbff8a31beb19d38b2a680625a19240a4f0.tar.xz
Make FPDFBitmap_GetFormat() work for JBIG images.
BUG=pdfium:945 Change-Id: I2a880e747b6f5a2fabed4d34ce47b69ff589ce3f Reviewed-on: https://pdfium-review.googlesource.com/27814 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.cpp4
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp
index 8a752374b6..3c8d471767 100644
--- a/core/fpdfapi/render/cpdf_dibsource.cpp
+++ b/core/fpdfapi/render/cpdf_dibsource.cpp
@@ -708,6 +708,10 @@ RetainPtr<CPDF_DIBSource> CPDF_DIBSource::DetachMask() {
return std::move(m_pMask);
}
+bool CPDF_DIBSource::IsJBigImage() const {
+ return m_pStreamAcc->GetImageDecoder() == "JBIG2Decode";
+}
+
CPDF_DIBSource::LoadState CPDF_DIBSource::StartLoadMaskDIB() {
m_pMask = pdfium::MakeRetain<CPDF_DIBSource>();
LoadState ret = m_pMask->StartLoadDIBSource(
diff --git a/core/fpdfapi/render/cpdf_dibsource.h b/core/fpdfapi/render/cpdf_dibsource.h
index a3e44c57e7..a29385f6ad 100644
--- a/core/fpdfapi/render/cpdf_dibsource.h
+++ b/core/fpdfapi/render/cpdf_dibsource.h
@@ -76,6 +76,8 @@ class CPDF_DIBSource : public CFX_DIBSource {
LoadState ContinueLoadDIBSource(IFX_PauseIndicator* pPause);
RetainPtr<CPDF_DIBSource> DetachMask();
+ bool IsJBigImage() const;
+
private:
CPDF_DIBSource();