summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-01 15:42:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-01 15:42:47 +0000
commit53341dd518f1b6f2969529dd62ccd6e605af182b (patch)
tree0e91b056275fa48670b924cb89a23b30b1c84185 /fpdfsdk
parent98037a0f758b4ebd3b9bedf571ae4ef791251276 (diff)
downloadpdfium-53341dd518f1b6f2969529dd62ccd6e605af182b.tar.xz
Add a test for FPDFImageObj_GetBitmap() with a JBIG image.
The test expectations are for the current failure state. BUG=pdfium:945 Change-Id: I1be503860b2ad5cbb0466793c9fa1438b3fc43d7 Reviewed-on: https://pdfium-review.googlesource.com/27770 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfedit_embeddertest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index 8c97d42365..8754a665f7 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -1122,6 +1122,26 @@ TEST_F(FPDFEditEmbeddertest, ExtractImageBitmap) {
UnloadPage(page);
}
+TEST_F(FPDFEditEmbeddertest, ExtractJBigImageBitmap) {
+ ASSERT_TRUE(OpenDocument("bug_631912.pdf"));
+ FPDF_PAGE page = LoadPage(0);
+ ASSERT_TRUE(page);
+ ASSERT_EQ(1, FPDFPage_CountObjects(page));
+
+ FPDF_PAGEOBJECT obj = FPDFPage_GetObject(page, 0);
+ ASSERT_EQ(FPDF_PAGEOBJ_IMAGE, FPDFPageObj_GetType(obj));
+ {
+ // TODO(bug_945): This should return a valid bitmap. This test should be
+ // able to successfully check |bitmap| using FPDFBitmap_GetFormat() and
+ // CompareBitmap().
+ std::unique_ptr<void, FPDFBitmapDeleter> bitmap(
+ FPDFImageObj_GetBitmap(obj));
+ ASSERT_FALSE(bitmap);
+ }
+
+ UnloadPage(page);
+}
+
TEST_F(FPDFEditEmbeddertest, GetImageData) {
EXPECT_TRUE(OpenDocument("embedded_images.pdf"));
FPDF_PAGE page = LoadPage(0);