-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul pdfobj #176
Overhaul pdfobj #176
Conversation
Do we have a plan to use |
We need to provide |
Pdf is byte-oriented format, so:
|
|
|
c324a6e
to
58c211e
Compare
Ok, it's much worse. Switching back. |
I thing the hashmap can hold multiple values with the same key. You could try |
58c211e
to
365d119
Compare
@mulimoen Hm? The old linked list code would loop until it found the same key, and replace it, and pdf_obj_release the existing value. If it didn't find any, it would tack it on the end. There were never any dupes. IndexMap has the same properties. It's just a hashmap that preserves insertion order. |
@cormacrelf I assumed it was using |
(Takes on `png` dependency -- this will be shared by `image`, eventually, hopefully.)
Ok, I think that's going to pass, we'll see in 125 minutes. But I'm mostly happy. |
Well, if anyone can figure out what's wrong, let me know, otherwise I'll try bisecting into multiple PRs. |
It's better to split this PR on several in any case. |
@@ -123,9 +129,49 @@ impl pdf_obj { | |||
pub fn is_array(&self) -> bool { | |||
PdfObjType::from(self.typ) == PdfObjType::ARRAY | |||
} | |||
pub fn get_array_mut(&mut self) -> &mut PdfArray { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better as_array_mut
like in lopdf
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
Depends on #175
indexmap
🎉operate directly on streams
Note that review is a bit annoying as I abstracted away
*mut pdf_obj
behing a type alias,PdfObjRef
. You can basically click 'viewed' on every file exceptdpx_pdfobj.rs
.