Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Unified Diff: fpdfsdk/fpdfeditimg.cpp

Issue 2529543003: Add inline JPEGs. (Closed)
Patch Set: Consolidate common code Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fpdfsdk/fpdfeditimg.cpp
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp
index 531a9abc8c9debe6157448cd7b5608dc2856e197..f74752b3c7f3486cbee9d7b4ca68e17eb280c37d 100644
--- a/fpdfsdk/fpdfeditimg.cpp
+++ b/fpdfsdk/fpdfeditimg.cpp
@@ -24,11 +24,11 @@ FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) {
return pImageObj;
}
-DLLEXPORT FPDF_BOOL STDCALL
-FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages,
- int nCount,
- FPDF_PAGEOBJECT image_object,
- FPDF_FILEACCESS* fileAccess) {
+FPDF_BOOL FPDFImageObj_LoadJpegHelper(FPDF_PAGE* pages,
+ int nCount,
+ FPDF_PAGEOBJECT image_object,
+ FPDF_FILEACCESS* fileAccess,
+ bool inlineJpeg) {
if (!image_object || !fileAccess || !pages)
return false;
@@ -40,11 +40,29 @@ FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages,
if (pPage)
pImgObj->GetImage()->ResetCache(pPage, nullptr);
}
- pImgObj->GetImage()->SetJpegImage(pFile);
+ pImgObj->GetImage()->SetJpegImage(pFile, inlineJpeg);
return true;
}
+DLLEXPORT FPDF_BOOL STDCALL
+FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages,
+ int nCount,
+ FPDF_PAGEOBJECT image_object,
+ FPDF_FILEACCESS* fileAccess) {
+ return FPDFImageObj_LoadJpegHelper(pages, nCount, image_object, fileAccess,
+ false);
+}
+
+DLLEXPORT FPDF_BOOL STDCALL
+FPDFImageObj_LoadJpegFileInline(FPDF_PAGE* pages,
+ int nCount,
+ FPDF_PAGEOBJECT image_object,
+ FPDF_FILEACCESS* fileAccess) {
+ return FPDFImageObj_LoadJpegHelper(pages, nCount, image_object, fileAccess,
+ true);
+}
+
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object,
double a,
double b,

Powered by Google App Engine
This is Rietveld 408576698