| <<<Back 1 day (to 2019/03/13) | 20190314 |
paulgardiner | ator: form signing is broken. We create a /Contents string to store the digest, initially set to all zeros. We rely on its being written out in hex, but it looks like it's being written as characters with escapes... strange because the looks to be doubling the size. | 09:22.37 |
ator | paulgardiner: huh. there's some logic in there to print it in the smallest form (be that binary or hex or escaped) | 09:36.48 |
| a bit depending on the pdf write options | 09:36.56 |
| adding a check for this specific key wouldn't be too difficult, I hope | 09:37.52 |
| paulgardiner: yeah, we shouldn't be doubling the size needlessly, that sounds like a real bug | 09:38.47 |
paulgardiner | Perhaps \0 is being classified wrongly, so the need to escape is being ignored in that calculation. | 09:42.52 |
ator | paulgardiner: if it's all zeroes then it'd be the same length | 09:44.48 |
| paulgardiner: are you hardwiring the hex parsing? | 09:49.15 |
paulgardiner | I'm seeing \000\000\000 | 09:49.16 |
ator | paulgardiner: strange. that shouldn't happen. | 09:49.33 |
paulgardiner | Maybe I'm misinterpreting what Xcode is showing me. I'll check. | 09:49.55 |
ator | see the logic in fmt_obj in pdf-object.c (line 2082) | 09:50.11 |
paulgardiner | I'm assuming hex when overwritting the buffer with the actual digest at the later stages of saving. | 09:50.48 |
ator | paulgardiner: right. | 09:51.04 |
| I've got a potential fix for always printing it as hex if it is /Type/Annot /Subtype/Widget /FT/Sig | 09:51.39 |
| but I'd like to figure out why it's writing (\000\000\000) when <000000> would be shorter | 09:52.02 |
paulgardiner | It makes sense to use hex for that sort of random data, and we need some method to ensure the iniitial buffer is big enough. | 09:52.09 |
ator | random binary data should be coming out as either hex or raw data | 09:52.34 |
| is this object created with pdf_save_document? | 09:53.09 |
paulgardiner | Yeah | 09:53.24 |
| Maybe. Not sure what you mean | 09:53.45 |
| It's created in an initial all zeros state and saved, then overwritten | 09:54.05 |
ator | if it's created all zeroes, then it should be coming out as hex | 09:55.52 |
| if it's not, I'll need to track it down. I think I've managed to misplace my signature file for signing stuff. | 09:56.49 |
paulgardiner | Was the change made in a single commit or multiple ones. I'm not using the end of master | 09:56.52 |
ator | paulgardiner: it was made a while ago, but there were some bugs in it that got fixed | 09:57.09 |
| so if you're more than a few months stale, that could be it | 09:57.17 |
| do you have a function "is_longer_than_hex" in pdf-object.c? | 09:57.34 |
paulgardiner | grep -r says no | 09:58.53 |
ator | paulgardiner: cherry-pick this then d2aed2053240787bf423ea2e4f63faa4634b265b | 09:58.59 |
paulgardiner | Thanks | 09:59.10 |
ator | you may also need 73a4d3a5babc4293263b2fb00f7e2858bd42a52b | 09:59.17 |
| that's a two week window in early february | 09:59.55 |
paulgardiner | ator: It's because strchr can locate the terminating \0 | 11:39.30 |
| Just reordering the two "else if" clauses should fix it | 11:40.01 |
| So using strchr to test set membership has a nasty trap | 11:41.16 |
ator | paulgardiner: ooohhh! | 11:53.24 |
paulgardiner | Swapping those clauses looks to have worked. I'll stick it on the muso branch | 11:53.56 |
ator | that won't quite work (then it'll say 4 for all characters < 32) | 11:55.00 |
paulgardiner | Oh yeah. I'm forgetting where \n\r live | 12:01.18 |
| Just add a clause specifically for null? | 12:01.44 |
ator | I think adding an if (s[i] == 0) m += 4; case before the strchr set test should do it | 12:01.46 |
paulgardiner | Yeah | 12:02.53 |
ator | paulgardiner: there's a commit for that on tor/master that should be cherry-pickable | 12:05.21 |
| assuming you want to pull it to your release branch | 12:05.32 |
paulgardiner | Thanks | 12:05.44 |
| Damn! I already pushed my broken version and I can't non-fast-forward push | 12:11.06 |
| Not important. Just messy | 12:11.47 |
ator | paulgardiner: I can turn on force pushes temporarily if you want to fix | 12:28.49 |
| paulgardiner: you should be able to force push now | 12:29.32 |
paulgardiner | No, don't worry. I just explicitly reverted mine and cherry-picked yours | 12:29.37 |
| Thanks all the same | 12:29.44 |
| :-) | 12:29.47 |
ator | paulgardiner: for future reference, if you edit the "denyNonFastForwards = true" line in /home/git/mupdf.git/config you can allow non-FF pushes | 12:30.24 |
| we've set it to deny by default to prevent accidents | 12:30.44 |
paulgardiner | Appreciated: I like to be protected from my slips. :-) | 12:31.48 |
ator | I think the worst slip was when someone force pushed a thirdparty submodule to the main repo | 12:33.26 |
| so all of a sudden mupdf.git was now LittleCMS. | 12:33.48 |
paulgardiner | Oh nasty | 12:36.07 |
ator | came back on monday to a flurry of emails asking where the mupdf project had gone :) | 12:36.41 |
| that proved we (a) shouldn't force git submodules on the gs folks, and (b) time to put in some safe guards | 12:37.07 |
sebras | ator: PDFDocument_nativeSaveWithStream() has the same problem with fz_var(). | 15:12.26 |
ator | sebras: any others? | 15:15.01 |
sebras | ator: now that I found by searching for "owned". | 15:33.04 |
| ator: men det kan finnas andra. | 15:33.17 |
tom- | Hello! | 16:30.23 |
sebras | tom-: hello, please feel free to ask questions. | 16:30.56 |
tom- | hi sebras, thanks | 16:31.08 |
| i see an example of how to define a global json object to be used from js. i wondered how i would access a specific member of the json object again from c after it was altered in js. | 16:31.55 |
| speaking of MuJS | 16:32.20 |
| from https://github.com/ccxvii/mujs | 16:32.44 |
| https://github.com/ccxvii/mujs/blob/master/docs/examples.html#L82 | 16:33.19 |
| i was trying js_getglobal(J, "t"); | 16:34.18 |
| how can the json object t be accessed in c? for instance t.bar | 16:36.00 |
| thanks for any guidance | 16:36.23 |
| there was a reference to this irc channel from MuJS, i hope this is the right place | 16:39.30 |
| sebras: ? | 16:39.51 |
pink_mist | this is the right place | 16:48.30 |
| it might not be the best time though | 16:48.39 |
| it's nearing the end of the work day in europe | 16:48.53 |
tom- | good, i'll hang around | 16:51.57 |
kens | It might be better to come back and read the logs, I suspect tehere won't be an answer today | 16:53.01 |
tom- | ok | 16:53.44 |
| kens: do you think the question was clear enough? | 16:55.46 |
kens | I'm not in a position to tell, sorry | 16:56.00 |
| The best placed person to answer is in Sweden, and its already nearly 6pm there. | 16:56.28 |
tom- | basically just looking for an example, they make it easy to understand and start | 16:56.34 |
| are you guys normally online during work-hours or in-between? | 16:57.05 |
sebras | tom-: for mujs your best bet is looking for ator during european business hours. | 16:58.04 |
kens | Office hours. For MuPDF and MuJS you want this channel and European office hours. For Ghostscript you would want #ghostscript, and there's more scope for getting an answer. Having said that, there is one engiener in this cahnnel currnetly (I htink) in Taiwan, so you never know | 16:58.05 |
tom- | i see :) | 16:58.37 |
sebras | yes, but I need to head off, its past midnight here (and I shouldn't be up too late again...) | 16:58.48 |
tom- | thanks for the infos sebras, kens, i'll come back later and/or read the log | 16:59.05 |
kens | NP | 16:59.11 |
tom- | bye | 16:59.17 |
Robin_Watts | ator, sebras: I'll take a run at answering cody. | 18:53.11 |
ator | tom-: js_getglobal(J, "JSON") will push the JSON object on the stack. then js_getproperty(J, -1, "stringify") will get the JSON.stringify property | 23:57.07 |
| Forward 1 day (to 2019/03/15)>>> | |