Log of #mupdf at irc.freenode.net.

Search:
 <<<Back 1 day (to 2017/07/12)20170713 
malc_` marrenarre: works here00:06.14 
marrenarre malc_`: You’re not noticing the same behaviour?00:06.31 
malc_` marrenarre: au contraire00:06.50 
marrenarre Linux/X?00:07.24 
malc_` marrenarre: + i300:07.36 
marrenarre Development version?00:07.43 
malc_` marrenarre: yes00:08.00 
marrenarre malc_`: So you first enable fullscreen via i3, and then you disable fullscreen via MuPDF, and it works perfectly?00:09.47 
malc_ oh.. no00:09.57 
marrenarre :P00:10.04 
  It works perfectly if you do both parts using the same method, but they don’t work well together.00:10.22 
malc_ marrenarre: and it's what it was made to do (looked at the source)00:10.25 
marrenarre ?00:10.45 
malc_ marrenarre: there simply isn't any code to watch for _NET_WM_STATE in mupdf so if you switch the fullscreen via WM, mupdf has no idea you've done so00:11.14 
  internally it still thinks it's in "normal" mode00:11.24 
marrenarre Well of course. That’s the problem.00:11.32 
  I think it should watch for it and adjust accordingly.00:12.40 
malc_ marrenarre: easier said than done :)00:12.54 
marrenarre Why so?00:13.13 
malc_ because one would need to hook property notify and given the asynchronous nature of x11 event delivery it still wouldn't work 100% of the time00:15.12 
marrenarre Oh. I wish I knew more about X11.00:15.55 
  I mean it seems to me like it is handling the events synchronously, and anyway it is already in fullscreen by the time it would handle it.00:16.24 
mvrhel_laptop Robin_Watts: So I just pushed a simple fix for the TextKnock page of the Altona file00:16.43 
  I think we are going to run into several of these types of issues as we push on. Luckily most should be this simple to fix00:17.06 
malc_ marrenarre: consider yourself lucky not knowing more about x11 :)00:18.03 
marrenarre Aww but I would like to make a window manager one day. :(00:18.22 
  How did you learn?00:18.38 
malc_ marrenarre: by not using xlib/xcb and talking the protocol directly00:19.04 
marrenarre But how did you learn to do that?00:19.15 
  (I read that people who do that are insane, by the way.)00:19.38 
malc_ marrenarre: by reading the protocol specification00:19.39 
marrenarre That sounds like the kind of thing that’s really long.00:20.02 
malc_ marrenarre: it's actually a lot easier than using xlib/xcb...00:20.06 
marrenarre Oh okay cool.00:20.22 
malc_ marrenarre: x11 protocol is a whole lot easier than one would imagine.. in fact Joe Armstrong wondered, in his PhD thesis, why people use those wrapper libraries, I decided to test his hunch that going for the protocol is easier, he was right, at least in my experience00:21.33 
marrenarre Is this what you read: https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html?00:21.54 
malc_ yep00:22.11 
  there are some dark corners though... XKEYBOARD, GLX among them00:22.52 
marrenarre That’s cool. Thanks for the info!00:23.05 
malc_ np.. btw. just checked my own mupdf based application, the one that talks protocol directly, it appears i only get fullscreen toggle via WM right half of the time... sigh00:24.43 
marrenarre Ah.00:26.16 
  Oh actually over half of that document is taken up by the appendices, the glossary, and the index.00:31.24 
malc_ marrenarre: it's very simple indeed00:32.09 
marrenarre I should definitely check it out some day.00:32.22 
malc_ marrenarre: http://repo.or.cz/llpp.git/commitdiff/1ee4d62d5f1fafe16fef5229c16481da9fe30cb2 thanks i guess :)00:44.06 
marrenarre malc_: You’re welcome…??00:46.44 
  Glad I could help I guess. :)00:47.01 
malc_ marrenarre: without your invaluable input i would have never discovered this 'orrible omission... i rarely switch this thing to and out of fullscreen via i3 key bindings :)00:48.10 
marrenarre Oh I see. Nice that you found it!00:52.12 
  Well, I should go now. It’s 03.35 here in fact.01:35.23 
  Good night!01:35.36 
mvrhel_laptop Robin_Watts: So two commits for you to look at. These fix the two issues that showed up on the clusterpush bmpcmp01:43.54 
Robin_Watts tor8: So, michaels latest changes are on robinn/mvrhel_master10:24.00 
  I reckon they are good to go.10:24.07 
  The bmpcmp on my area at the moment is the results of -filter=ppmraw.72.0 with a threshold of 64.10:24.51 
tor8 the X's are supposed to be invisible, right?10:51.01 
kens In general, yes10:51.33 
Robin_Watts tor8: yeah, so (barring edge effects), we are there.10:52.15 
tor8 the edge effects look like sort of errors you get when blending with alpha using non-premul math10:53.20 
  and interpolation.10:53.29 
kens Therte's something weird looking in test 47, page 710:55.37 
  bottom left corner, the second capital D is a strange colour10:55.57 
  page 15 some of the ovals are white, and shouldn't be10:56.46 
  actually some of them are gray and shouldn't be too10:57.11 
  Of course, they were wrong before too10:57.36 
  The whole left column seems to be incorrect10:58.01 
  Overall though, much improved10:58.49 
  The shadows in test 104 look like a regression, but I need to download the test file10:59.56 
Robin_Watts kens: Thanks for those. I'll pass that on to mvrhel to look at before I push.11:00.14 
tor8 Robin_Watts: so, if I'm reading this commit correct, we're holding ALL color values for CMYK inverted, not just the pixmap 0..255 byte values?11:00.27 
kens I just checked 104, the shadows are wrong now, were OK before11:00.40 
Robin_Watts tor8: yes.11:00.44 
  All values in a subtractive color space.11:00.53 
tor8 instinctive gut reaction: eww!11:00.54 
Robin_Watts tor8: I think it's neater than the alternative.11:01.15 
tor8 I can't remember why I added the fz_ensure_additive function in the first place. I have some vague recollection that it was to do with alpha blending.11:02.21 
  but now I can't convince myself that the math wouldn't work out just fine if we never inverted them11:02.37 
  then again, my math is rusty11:02.54 
Robin_Watts tor8: But are you happy with those commits on the whole?12:01.31 
  (robin/master has just been updated with my latest changes which build on top of michaels, to add spot color handling).12:02.09 
tor8 on the whole, yes, but I wonder if we can keep the colors non-inverted12:09.24 
Robin_Watts tor8: Feel free to try.12:59.30 
marrenarre Hello again. I was here yesterday, talking about the fullscreen issue. The issue is that enabling fullscreen via e.g. a window manager is not noticed by mupdf so when you try to disable it in mupdf afterwards, mupdf tries to enable fullscreen even though you are already in fullscreen (because you did not enable fullscreen through mupdf) and thus nothing happens.13:30.35 
  tor8: I was told to ask you about it.13:35.26 
tor8 marrenarre: yeah, fullscreen and x11 has historically been a bit of a mess13:36.17 
  are you using mupdf-x11 or mupdf-gl?13:36.30 
marrenarre I tried the development version of each and they both had this problem.13:36.43 
tor8 I'm not surprised. We don't listen to any particular WM message that we've been fullscreened.13:37.13 
  mupdf-gl uses GLFW13:38.30 
marrenarre malc_ explained to me that it would be quite complicated to fix this due to the asynchronous nature of X11.13:38.41 
tor8 mupdf-x11 sends a WM request to go fullscreen (NET_WM_STATE_FULLSCREEN)13:39.06 
  there might be a way to look at the window properties before asking to change state, but those window properties are not handled or set by all WMs13:40.15 
  it would be trivial, if only X11 had sent us a message that we've gone fullscreen and we could update our internal 'are we fullscreen' variable13:41.18 
  but as I recall it, there is no such message13:41.30 
  and that would only solve the bug in mupdf-x11 on x11, not for mupdf-gl13:42.13 
  marrenarre: are you in a position to build mupdf and test something for me?13:43.45 
  add a line printf("toggle_fullscreen %d\n", !!glfwGetWindowMonitor(window)); to the beginning of toggle_fullscreen() in platform/gl/gl-main.c and tell me what it prints when you've gone fullscreen in the wm and hit the fullscreen button in mupdf13:44.37 
  Robin_Watts: from my rudimentary experiments using the XPS and TIFF CMYK files with opacity it looks like things come out alpha composited correctly even when working in subtractive colorspaces13:59.07 
Robin_Watts tor8: I've spent long enough getting this working that I'm not changing tack on a vague promise.14:00.50 
  It's not just plotting that's the issue, it's all the different blend modes too.14:01.14 
tor8 Robin_Watts: of course! I want to get to the bottom of this.14:01.35 
marrenarre tor8: I’m cloning the repository ATM but it’s going very slowly for some reason.14:01.41 
Robin_Watts If you want to take michaels branch and turn that into an equivalent that that doesn't need the inversion, then great!14:01.57 
marrenarre Around 20 KiB/s.14:01.59 
tor8 Robin_Watts: on tor/subtractive is a commit that nobbles the is_additive stuff that should let us plot with cmyk subtractive spaces14:02.05 
  in tests_private/xps/ms/Handcrafted/ImagePixelFormats.xps on page 9 there is a CMYK-alpha tiff that needs premultiplying14:02.34 
Robin_Watts There is no is_additive in my current branch...14:02.49 
tor8 Robin_Watts: I know, I just took origin/master (before your inversion commit) and experiment with that14:03.13 
Robin_Watts right.14:03.25 
tor8 mutool draw -o out.ps -c cmyk tests_private/xps/ms/Handcrafted/ImagePixelFormats.xps 914:03.26 
  looks identical whether I use -c cmyk or -c rgb when viewing the output with gs14:03.50 
  (and I've added a printf to fz_new_pixmap_with_data to ensure we create CMYK rendering buffers, and we do)14:04.34 
  and nobbling the fz_premultiply_pixmap call in load-tiff.c results in two different renders14:07.21 
marrenarre tor8: toggle_fullscreen 014:15.31 
  toggle_fullscreen 114:15.31 
tor8 marrenarre: and the first time you press it, you're already in fullscreen?14:15.49 
marrenarre tor8: Yes.14:15.58 
tor8 marrenarre: damn. won't be an easy fix then :(14:16.07 
  because GLFW doesn't know that it's gone fullscreen14:16.15 
  Robin_Watts: I will try to tweak your mvrhel_master branch to not use inversion, and see what diffs we get14:17.40 
Robin_Watts tor8: cool. I'm neck deep in spots stuff at the moment, and desperately trying not to get distracted.14:18.04 
tor8 Okay, I shall do this in silence then :)14:18.30 
marrenarre tor8: Why doesn’t it know that? Isn’t it supposed to?14:19.58 
  What about this function: http://www.glfw.org/docs/3.0/group__window.html#gaeac25e64789974ccbe0811766bd91a16?14:21.57 
  Wait that’s the same one.14:22.42 
  Is this a bug or something? The behaviour doesn’t make sense given the description.14:23.06 
tor8 marrenarre: I suspect it only knows the state of the window when it was created; any modifications by the WM aren't reflected.14:28.04 
Robin_Watts boggles at fast_rgb_to_gray14:36.21 
  tor8: In commit a8a47bb3f2 you do rgb to gray by doing:14:39.31 
  d[0] = ((s[0]+1) * 77 + (s[1]+1) * 150 + (s[2]+1) * 28) >> 8;14:39.41 
  That's equivalently:14:39.57 
  d[0] = (s[0]*77 + s[1]*150 + s[2] * 28 + 255)>>814:40.21 
  Why the first form?14:40.48 
tor8 Robin_Watts: I honestly can't remember14:47.11 
  it *might* be me trying to scale up to 0..256 math by ugly hacking it14:47.36 
Robin_Watts The maths is correct (I just pencil and papered it to check).14:47.56 
  it correctly maps 0..255 -> 0..25514:48.14 
  (we don't want to go to 0..256)14:48.21 
marrenarre Oh well okay. That’s too bad.14:48.31 
tor8 Robin_Watts: the +1 form dates back to at least 2004, commit ce1bf1ef28a160c48c287d302ab7795330806cf0 is the first one I can find14:53.26 
Robin_Watts tor8: ah, well, no biggy. Was just wondering if there was some cunning reason I had missed.14:53.58 
tor8 you could probably ask sebastian to dig through the old old old original mupdf cvs :)14:55.30 
  the one I copied bits from to start the current code14:55.41 
  I know he's kept a copy of that sitting around somewhere14:55.56 
Robin_Watts tor8: And the odds of finding a reason in that are? :)14:56.19 
tor8 probably less than ideal :)14:56.39 
Robin_Watts It'll come down to a commit with a message like "Color conversions".14:56.44 
  :)14:56.47 
mvrhel_laptop morning Robin_Watts. So there were a few more files that were regressions?15:13.27 
Robin_Watts mvrhel_laptop: Morning.15:13.35 
  Yeah, kens spotted a few.15:13.38 
  tor8 thinks he can maybe make this all work without inverting subtractive colors, so he's giving that a go.15:14.23 
mvrhel_laptop ok I will look at those this morning15:14.29 
  Robin_Watts: ha15:14.31 
  maybe he can do the same with gs then?15:14.37 
  as it inverts all the subtractive colors before blending too15:14.51 
  I supposed if we had different blending equations for subtractive colors we could avoid doing the inversion15:17.12 
  But if we want to use the same equations then they are going to need to be inverted15:18.39 
  That is clear in the PDF spec15:18.44 
  tor8: ^^15:20.40 
sebras Robin_Watts: also that old cvs repo is not available to me atm.15:24.14 
Robin_Watts mvrhel_laptop: Hmm.15:33.40 
  just pondering a problem.15:33.48 
  When I call pdf_page_separations, I want to get the list of separations on a page back.15:34.06 
  This list includes names, and equivalent colors.15:34.17 
  In order to get the equivalent colors, I was going to load the colorspace, and convert '1' to rgb and cmyk respectively.15:34.55 
  But I don't have the default_cs stuff in the pdf_page_separations calls.15:35.19 
mvrhel_laptop hmm. That is unfortunate15:36.29 
Robin_Watts Maybe the fz_separations structure should contain a list of fz_colorspace pointers?15:37.20 
mvrhel_laptop It is definitely needed to get the correct color15:37.21 
Robin_Watts That way I can generate the equivalent colors direct as required.15:37.50 
mvrhel_laptop That would make sense15:37.51 
Robin_Watts yeah, that's doable, I think.15:38.18 
mvrhel_laptop I have the D chopped down. Need to eat breakfast before figuring this one out15:49.55 
  Robin_Watts: you there?16:45.36 
Robin_Watts I am.16:45.42 
mvrhel_laptop A performance question for you. I found the issue with the D color in the altona test.16:46.04 
  So when we have a non-isolated group we copy the backdrop to the new group16:46.32 
  but if the color space is different we need to do a color conversion. (Not doing the conversion is the source of the problem)16:47.05 
Robin_Watts right.16:47.11 
mvrhel_laptop right now we do a fz_copy_pixmap_rect16:47.20 
Robin_Watts fz_clone_pixmap_area_with_different_seps is probably what you want.16:48.03 
mvrhel_laptop It would be nice, when we need to do the conversion to just create a new pixmap the size of the bbox intersection and convert that16:48.04 
  is that an existing function?16:48.26 
Robin_Watts wouldn't it :)16:48.28 
  mvrhel_laptop: It exists in my branch.16:48.37 
mvrhel_laptop does it do what I just said above?16:49.06 
Robin_Watts That's what I use to do the bits you hate.16:49.06 
mvrhel_laptop I mean in terms of the interesection. I don't want to convert the whole backdrop16:49.37 
Robin_Watts given a source pixmap, and an fz_irect, and a destination colorspace and set of separations it makes the appropriate clone.16:49.47 
  yeah, just the given area.16:50.00 
mvrhel_laptop cool.16:50.10 
  so how should we do this? Should I pull that part into code?16:50.26 
  or do we wait on all of this16:50.44 
  and merge into one branch maybe?16:50.53 
Robin_Watts mvrhel_laptop: I am fairly tempted to say we should push what we have, cos it's far more of a progression than a regression.16:51.24 
mvrhel_laptop Robin_Watts: I agree.16:51.39 
Robin_Watts Did you check out the SEGV?16:51.41 
mvrhel_laptop oh let me do that now16:51.46 
  so that was tests_private/pdf/sumatra/1044_-_hidden_annotation_rendered.pdf.pgmraw?16:54.08 
Robin_Watts yeah, that rings a bell.16:54.57 
  robin/master now looks to be in reasonable shape, I think.16:55.08 
mvrhel_laptop great16:56.05 
  ha! The segv is caused by the fz_copy_pixmap_rect and the mismatch color spaces16:57.45 
  it ends up in the /* FIXME: Crap conversion */ section16:58.30 
  source is gray and destination is CMYK16:59.25 
  so, now what to do16:59.41 
  Robin_Watts: any suggestions?16:59.52 
  I could work on fixing the crap conversion....17:00.00 
  or I could pull in your fz_clone_pixmap_area_with_different_seps17:00.39 
Robin_Watts oh, urm...17:00.52 
  I dunno.17:01.36 
mvrhel_laptop let me look at fz_clone_pixmap_area_with_different_seps17:01.52 
  which commit is that in?17:02.37 
Robin_Watts mvrhel_laptop: best to just look at the tree on the final commit.17:03.30 
  http://git.ghostscript.com/?p=user/robin/mupdf.git;a=blob;f=source/fitz/separation.c;h=5baea132ff5b0197a623b9167ca1be3315ed3704;hb=d2ad809052f073b332c692759631ac585a7de00917:04.13 
  line 228 onwards.17:04.17 
mvrhel_laptop yes17:06.21 
  This looks like it will do what I need, but extracting it would be way too much work. I will fix the crap conversion so we don't segv so we can get the code in master17:07.26 
  Then we can fix this with your changes17:07.37 
Robin_Watts I'm just pondering on that now.17:07.43 
mvrhel_laptop Robin_Watts: one thing17:08.16 
  this function is much more complex that what I need17:08.28 
  In my case, we will always do the copy of the spots, and do the conversion of the process colorants17:09.02 
  so I could write a simpler one17:09.08 
  That would be another option17:09.15 
Robin_Watts yes, but hopefully in the event of their being no spots, it'll be fast.17:09.18 
mvrhel_laptop yes17:09.33 
Robin_Watts If no spots, or if the same number of spots, we can do an optimised branch.17:09.38 
  That Crap conversion block makes no sense to me.17:10.11 
mvrhel_laptop the error is that sn = 017:10.57 
  division by zero line 38017:11.10 
Robin_Watts mvrhel_laptop: Yeah, it hasn't been updated since src->alpha etc.17:11.26 
mvrhel_laptop as src->n = 117:11.28 
Robin_Watts Fixed version on the top of robin/master17:12.05 
  or at least, a version for your consideration.17:12.20 
mvrhel_laptop cool17:13.26 
  ok. just need to fix dst to dest. but no more segv17:15.57 
  and output looks reasonable17:16.33 
  and altona still looks the same, but we know how we are going to fix that17:18.13 
Robin_Watts cool.17:18.24 
mvrhel_laptop Robin_Watts: Do you want to move that crap conversion down to where your mvrhel_master is and then do a clusterpush just to make sure?17:20.35 
Robin_Watts mvrhel_laptop: Sure.17:20.47 
mvrhel_laptop cool. I have to run Ethan to bus. I will be back in a bit to see the results17:21.08 
Robin_Watts I suppose we ought to look at bmpcmps for other than ppmraw.17:24.08 
malc_ Robin_Watts: mupdf_explored.pdf page 52 mentions FZ_IGNORE_SHADE - a thing that no longer exists17:26.11 
Robin_Watts malc_: Thanks.17:26.36 
  malc_: To avoid me losing these comments (for which I am very grateful), could you stick 'em on a bug for me please?17:30.13 
malc_ Robin_Watts: page 53 - FZ_DONT_INTERPOLAGE_IMAGES G=T17:30.22 
  Robin_Watts: can you open the bug first then i can comment and add the stuff as it's being discovered?17:30.55 
Robin_Watts Sure.17:31.01 
  malc_: https://bugs.ghostscript.com/show_bug.cgi?id=69824617:32.13 
malc_ Robin_Watts: thanks17:35.23 
mvrhel_laptop Robin_Watts: wow18:55.19 
  ok let me look at 312 for a sec18:55.27 
Robin_Watts These might be the same issue maybe?18:56.40 
mvrhel_laptop very likely18:56.46 
  maybe I should just do a conversion18:56.54 
  and we can optimize it out when we pull your changes in18:57.22 
Robin_Watts Probably we should have fz_copy_pixmap_rect actually work in all cases :)18:57.25 
mvrhel_laptop yes. oh I could do the conversion there18:57.38 
Robin_Watts yeah.18:57.44 
mvrhel_laptop ok let me do that18:57.49 
  that should be simple enough18:58.21 
Robin_Watts I have to head off and deal with puppy chaos. will check back in later.18:58.24 
mvrhel_laptop ok. have fun :)18:58.33 
  hmm interesting. D still has issue after this fix. digging further19:22.34 
  Robin_Watts: so my fix did not fix the issues in 312 and friends. looking into this as there is something odd going on20:02.01 
  ok. I have hacked this file to the point where it has to be obvious what is goiing onn20:21.45 
  lunch20:31.37 
malc_ Robin_Watts: not sure if it's worth a bug comment, but your spelling is somehow inconsistent... behaviour, specialised but color20:37.16 
  Robin_Watts: actually you have both colour and color...20:38.49 
Robin_Watts yeah. I am torn...23:12.29 
malc_ yeah patriotism vs more typing.. hard choice23:23.01 
Robin_Watts Correct spelling vs colonial :)23:30.47 
malc_ hah23:34.28 
 Forward 1 day (to 2017/07/14)>>> 
ghostscript.com #ghostscript
Search: