Skip to content

Commit

Permalink
Fix /ColorSpace placement issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ashariyar committed Oct 16, 2022
1 parent 51274fa commit 863a66e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# NEXT RELEASE

### 1.11.4
* Fix parent/child issue with `/Annots` arrays being indeterminate

### 1.11.3
Expand Down
5 changes: 1 addition & 4 deletions pdfalyzer/pdfalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,9 @@ def _resolve_indeterminate_nodes(self) -> None:
set_lowest_id_node_as_parent = True
possible_parent_relationships = node.non_tree_relationships # TODO 'possible_parent_relationships'
addresses = node.unique_addresses()
# TODO: this name sucks
unique_labels_of_referring_nodes = list(set([r.from_node.label for r in node.non_tree_relationships]))
common_ancestor_among_possible_parents = node.common_ancestor_among_non_tree_relationships()

if node.idnum == 8148:
import pdb;pdb.set_trace()
# TODO we should have removed the node from indeterminate_node_ids before this point
if node.parent is not None:
log.info(f"{node} marked indeterminate but already has parent: {node.parent}")
Expand All @@ -317,7 +314,7 @@ def _resolve_indeterminate_nodes(self) -> None:

if len(unique_labels_of_referring_nodes) == 1:
log.info(f"Single label for all of {node}'s relationships; setting parent as lowest id")
elif node.label == COLOR_SPACE:
elif node.type == COLOR_SPACE:
log.info("Color space node found; placing at lowest ID")
elif len(addresses) == 1:
log.info(f"{node}'s other relationships all use key {addresses[0]}, linking to lowest id")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pdfalyzer"
version = "1.11.3"
version = "1.11.4"
description = "A PDF analysis toolkit. Scan a PDF with relevant YARA rules, visualize its inner tree-like data structure in living color (lots of colors), force decodes of suspicious font binaries, and more."
authors = ["Michel de Cryptadamus <[email protected]>"]
license = "GPL-3.0-or-later"
Expand Down

0 comments on commit 863a66e

Please sign in to comment.