Issue 1468 in pdfium: Extract ICC Profile

112 views
Skip to first unread message

roman.wu… via monorail

unread,
Jan 29, 2020, 1:09:50 AM1/29/20
to pdfiu...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1468 by roman.wu...@gmail.com: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468

PDFium does correctly support ICC Profile extraction only for internal purposes.

It would be good to have a public API function where the ICC Profile can be extracted it processed further with e.g. ImageMagick or tools like that.

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

thes… via monorail

unread,
Jan 31, 2020, 1:57:04 AM1/31/20
to pdfiu...@googlegroups.com

Comment #1 on issue 1468 by the...@chromium.org: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c1

Using the PDF in bug 1453 as an example, object 27 0 is an image with object 29 0 as an colorspace. The colorspace is /ICCBased and references object 30.

You want the uncompressed data stream from object 30 0 in this case?

roman.wu… via monorail

unread,
Jan 31, 2020, 2:59:16 AM1/31/20
to pdfiu...@googlegroups.com

Comment #2 on issue 1468 by roman.wu...@gmail.com: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c2

Correct, in this case it should be 3144 bytes

thes… via monorail

unread,
Jan 31, 2020, 1:05:22 PM1/31/20
to pdfiu...@googlegroups.com
Updates:
Labels: HotList-GoodFirstBug
Status: Accepted

Comment #3 on issue 1468 by the...@chromium.org: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c3

Sounds good. We'll accept this bug, but it's probably not going to be prioritized.

Though it is not hard to implement, so contributions are welcome. FPDFImageObj_GetImageMetadata() currently returns the colorspace type. From its implementation, one can see CPDF_DIB::GetColorSpace) returns a CPDF_ColorSpace pointer. CPDF_ICCBasedCS is a subclass of CPDF_ColorSpace, and it holds a CPDF_IccProfile that holds the ICC data.

cdoko… via monorail

unread,
Apr 10, 2020, 3:56:12 AM4/10/20
to pdfiu...@googlegroups.com

Comment #5 on issue 1468 by cdoko...@gmail.com: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c5

I'll add that expanded access to colorspace data would be a marvelous addition because images with indexed colorspaces rendered through FPDFImageObj_GetBitmap() do not get their pixels in their full RGB values, just their index (8 bits), resulting in a pseudo-grayscale bitmap where each color is seen as a different gray value (seemingly random in many cases and usually near-black). Unless FPDFImageObj_GetBitmap() is changed, access to the indexed colorspace is necessary to get any useful result.

roman.wu… via monorail

unread,
Jun 23, 2020, 3:24:37 PM6/23/20
to pdfiu...@googlegroups.com

Comment #6 on issue 1468 by roman.wu...@gmail.com: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c6

Hello,

thanks to all which are implementing/fixing it.
Is this issue already checked in?

thes… via monorail

unread,
Jun 23, 2020, 3:29:43 PM6/23/20
to pdfiu...@googlegroups.com

Comment #7 on issue 1468 by the...@chromium.org: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c7

Nobody has done any work on this. If somebody did, there would have been a notification here about it.

roman… via monorail

unread,
Nov 1, 2020, 12:16:10 PM11/1/20
to pdfiu...@googlegroups.com

Comment #8 on issue 1468 by roman...@gmail.com: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c8

Ok, i have implemented it, but what header files are allowed to be used in the "../pdfium/public/fpdf_edit.h" header file? I can use a forward declaration because i need CPDF_ColorSpace but lately in the unit tests i need some header file. Is #include "core/fpdfapi/page/cpdf_colorspace.h" allowed?

The next question is how can i provide a pull request?

Thanks in advance

n… via monorail

unread,
Nov 3, 2020, 2:24:52 PM11/3/20
to pdfiu...@googlegroups.com

Comment #9 on issue 1468 by ni...@chromium.org: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c9

Re comment 8:
Would you mind uploading a code change to Gerrit (https://pdfium-review.googlesource.com/) so that we can have reviewers to review the change?
Here is the guideline to contribute code to PDFium https://pdfium.googlesource.com/pdfium/+/refs/heads/master/CONTRIBUTING.md.

roman… via monorail

unread,
Nov 11, 2020, 4:38:56 PM11/11/20
to pdfiu...@googlegroups.com

Comment #10 on issue 1468 by roman...@gmail.com: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c10

How can I push to gerrit, because every try to push is rejected.

Let's say this examples:
git push origin HEAD:refs/for/HEAD

Tried to push the branch itself:
git push origin bugfix_1468:refs/for/bugfix_1468

km… via monorail

unread,
Nov 11, 2020, 5:30:14 PM11/11/20
to pdfiu...@googlegroups.com

Comment #11 on issue 1468 by km...@chromium.org: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c11

This is typically done with the "git cl upload" command. You can try adapting the instructions for Chromium here:
https://chromium.googlesource.com/chromium/src/+/master/docs/contributing.md#Uploading-a-change-for-review

roman… via monorail

unread,
Nov 12, 2020, 9:10:20 AM11/12/20
to pdfiu...@googlegroups.com

Comment #12 on issue 1468 by roman...@gmail.com: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c12

OK thanks, it can be found here: https://pdfium-review.googlesource.com/c/pdfium/+/76250

n… via monorail

unread,
Nov 12, 2020, 2:46:56 PM11/12/20
to pdfiu...@googlegroups.com

Comment #13 on issue 1468 by ni...@chromium.org: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c13

Thanks for uploading the CL! We will start the reviewing process from there.

n… via monorail

unread,
Nov 12, 2020, 3:15:28 PM11/12/20
to pdfiu...@googlegroups.com

Comment #14 on issue 1468 by ni...@chromium.org: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c14

Re reporter@:

It seems like you haven't signed the individual licence agreement and added yourself to the AUTHOR list (https://pdfium.googlesource.com/pdfium/+/refs/heads/master/AUTHORS).
These are the steps to be done before we can accept the code contribution.

For details about how to complete these steps, please check https://pdfium.googlesource.com/pdfium/+/refs/heads/master/CONTRIBUTING.md#cla

Please let us know once these steps are completed.

Thanks!

roman… via monorail

unread,
Nov 16, 2020, 2:53:30 PM11/16/20
to pdfiu...@googlegroups.com

Comment #15 on issue 1468 by roman...@gmail.com: Extract ICC Profile
https://bugs.chromium.org/p/pdfium/issues/detail?id=1468#c15

Please see patchset 2 for the modifications
Reply all
Reply to author
Forward
0 new messages