Commit 86f9b4c43be182abe46d035a859f22b82cd844aa
1 parent
62ea3b91
Add colorspace and depth information in json for images
Showing
1 changed file
with
13 additions
and
0 deletions
qpdf/qpdf.cc
| ... | ... | @@ -294,6 +294,9 @@ static JSON json_schema(std::set<std::string>* keys = 0) |
| 294 | 294 | JSON image = page.addDictionaryMember("images", JSON::makeArray()). |
| 295 | 295 | addArrayElement(JSON::makeDictionary()); |
| 296 | 296 | image.addDictionaryMember( |
| 297 | + "name", | |
| 298 | + JSON::makeString("name of image in XObject table")); | |
| 299 | + image.addDictionaryMember( | |
| 297 | 300 | "object", |
| 298 | 301 | JSON::makeString("reference to image stream")); |
| 299 | 302 | image.addDictionaryMember( |
| ... | ... | @@ -302,6 +305,12 @@ static JSON json_schema(std::set<std::string>* keys = 0) |
| 302 | 305 | image.addDictionaryMember( |
| 303 | 306 | "height", |
| 304 | 307 | JSON::makeString("image height")); |
| 308 | + image.addDictionaryMember( | |
| 309 | + "colorspace", | |
| 310 | + JSON::makeString("color space")); | |
| 311 | + image.addDictionaryMember( | |
| 312 | + "bitspercomponent", | |
| 313 | + JSON::makeString("bits per component")); | |
| 305 | 314 | image.addDictionaryMember("filter", JSON::makeArray()). |
| 306 | 315 | addArrayElement( |
| 307 | 316 | JSON::makeString("filters applied to image data")); |
| ... | ... | @@ -2695,6 +2704,10 @@ static void do_json_pages(QPDF& pdf, Options& o, JSON& j) |
| 2695 | 2704 | "width", dict.getKey("/Width").getJSON()); |
| 2696 | 2705 | j_image.addDictionaryMember( |
| 2697 | 2706 | "height", dict.getKey("/Height").getJSON()); |
| 2707 | + j_image.addDictionaryMember( | |
| 2708 | + "colorspace", dict.getKey("/ColorSpace").getJSON()); | |
| 2709 | + j_image.addDictionaryMember( | |
| 2710 | + "bitspercomponent", dict.getKey("/BitsPerComponent").getJSON()); | |
| 2698 | 2711 | QPDFObjectHandle filters = dict.getKey("/Filter").wrapInArray(); |
| 2699 | 2712 | j_image.addDictionaryMember( |
| 2700 | 2713 | "filter", filters.getJSON()); | ... | ... |