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

Unified Diff: fpdfsdk/fpdfeditimg.cpp

Issue 2529543003: Add inline JPEGs. (Closed)
Patch Set: Add new API for inline JPEGs 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
« no previous file with comments | « core/fpdfapi/page/cpdf_image.cpp ('k') | public/fpdf_edit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfeditimg.cpp
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp
index 531a9abc8c9debe6157448cd7b5608dc2856e197..a3ac17d656e96e9e91fddd05739cc06ee1b869ef 100644
--- a/fpdfsdk/fpdfeditimg.cpp
+++ b/fpdfsdk/fpdfeditimg.cpp
@@ -45,6 +45,27 @@ FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages,
return true;
}
+DLLEXPORT FPDF_BOOL STDCALL
+FPDFImageObj_LoadJpegFileInline(FPDF_PAGE* pages,
weili 2016/12/13 21:55:01 Can this and FPDFImageObj_LoadJpegFile() share com
rbpotter 2016/12/14 01:03:28 Done.
+ int nCount,
+ FPDF_PAGEOBJECT image_object,
+ FPDF_FILEACCESS* fileAccess) {
+ if (!image_object || !fileAccess || !pages)
+ return false;
+
+ CFX_RetainPtr<IFX_SeekableReadStream> pFile =
+ MakeSeekableReadStream(fileAccess);
+ CPDF_ImageObject* pImgObj = reinterpret_cast<CPDF_ImageObject*>(image_object);
+ for (int index = 0; index < nCount; index++) {
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]);
+ if (pPage)
+ pImgObj->GetImage()->ResetCache(pPage, nullptr);
+ }
+ pImgObj->GetImage()->SetJpegImageInline(pFile);
+
+ return true;
+}
+
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object,
double a,
double b,
« no previous file with comments | « core/fpdfapi/page/cpdf_image.cpp ('k') | public/fpdf_edit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698