Log of #mupdf at irc.freenode.net.

Search:
 <<<Back 1 day (to 2017/10/23)20171024 
tor8 sebras: so, PDFDocument_save returning an int seems wrong to me09:41.06 
  sebras: and as I understand it, it also doesn't matter since most of the places we return a value it will be ignored because the exception flag will have been set09:41.34 
  if GetStringUTFChars returns NULL, it will also flag an exception09:42.33 
  so commit dbce095776a918960c063503a7591e34bfde83d4 should make no difference, if I understand things correctly09:43.12 
  anyway, if we get errors, throwing an exception is the thing to do in java, not return a numeric code09:43.45 
Dhama Hello09:58.06 
mubot Welcome to #mupdf, the channel for MuPDF. If you have a question, please ask it, don't ask to ask it. Do be prepared to wait for a reply as devs will check the logs and reply when they come on line.09:58.06 
Dhama In Landscape mode I need to make two page visible and in Portrait mode only one page need to show.09:59.08 
tor8 Dhama: windows? linux? ios? android?09:59.41 
Dhama Android09:59.47 
tor8 Dhama: that will be difficult. which code base are you working from?10:00.24 
Dhama We are using mupdf Version 1.910:01.52 
tor8 Dhama: are you a licensed customer, or is this an open source app?10:02.22 
Dhama Open Source10:02.36 
tor8 1.9 is quite old.10:02.41 
Dhama Which is latest version ?10:03.06 
tor8 we're working on a new android sdk which will be out in a few weeks, which is easier to get up and running10:03.09 
  1.11 is the latest10:03.12 
Dhama Is it Open Source ?10:03.40 
tor8 if you don't need editing and form filling features, you could take a look at the mupdf-android-viewer-mini project10:03.47 
Dhama And in this 1.11 Landscape mode have 2 page is this feature it there ?10:04.14 
tor8 it uses a new low level JNI library we've created, which should make creating custom code much easier10:04.19 
  it would be easier for you to modify the mupdf-mini code to have a 2-page display than modifying the 1.9 app10:04.54 
Dhama Possible to share downloaded URL or git page ?10:05.23 
tor8 see http://git.ghostscript.com/10:05.48 
  http://git.ghostscript.com/?p=mupdf-android-viewer-mini.git;a=summary more specifically10:05.57 
Dhama So this version you guys implemented double page ?10:07.05 
  Means in this code that double page is there in landscape mode ?10:09.36 
tor8 No. Like I said before: the mupdf-mini code is easier for you to change if you want to implement a double page display.10:12.11 
  we do not implement a 2-page display in any of the mobile viewers.10:12.52 
Dhama Okay, You guys have any planning to add this feature in future ?10:13.21 
tor8 it is not on the road map. if we do it at all, it will be several years into the future.10:14.25 
  I'm curious, what is your app?10:15.14 
Dhama I will explain you, Give me 10 mins.10:16.26 
  There is Platform folder and in that folder android and iOS folder is missing which is previously there10:17.09 
  in 1.910:17.17 
tor8 We split the android and ios projcets into separate git repositories in version 1.10 or 1.11 (I can't exactly remember when)10:17.58 
Dhama So now I need to compile app in andorid so in which branch I need to take a pull I will share one screen shot with you over here.10:20.47 
  Please have a look in this screen shot10:21.14 
  https://www.dropbox.com/s/kgf1lowywgzc947/Screenshot%20-%2010_24_2017%20%2C%203_49_17%20PM.png?dl=010:21.15 
tor8 The viewer is in a different git repository.10:25.35 
  see https://mupdf.com/docs/android-build-viewer.html10:25.59 
Dhama Okay, Give me 10 mins I will check it.10:32.16 
  I am using this same which I already shred image with you .10:33.50 
  There is Viewer folder but there is no iOS and Andorid code10:34.22 
  https://mupdf.com/downloads10:38.07 
  mupdf-1.11-source.tar.gz I download this folder10:38.21 
  But there is no Android Folder as well as viewer folder10:38.38 
  Which I need to download for Android code ?10:42.50 
  https://www.dropbox.com/s/j7vh5sxsyw1y2rm/Screenshot%202017-10-24%2016.12.05.png?dl=010:42.51 
tor8 We do not provide source code downloads for the Android viewer. You need to check out the git repository.10:44.50 
Dhama Its already10:45.09 
  But same there is no code10:45.16 
  In git there is no code for Viewer10:45.31 
tor8 What part of "The viewer is in a different git repository." do you not understand?10:45.40 
  Are you *sure* that your app is covered by the GPL? Where can I download the source to your app?10:46.48 
Dhama Dont worry about it. App source code is not available but its free in market . Currently my app is not available in store.10:48.19 
kens Being free is not adequate for conformance with the AGPL10:49.14 
  You *must* make the source code available10:49.24 
Dhama Okay, Once it competed I will share on Github.com10:49.50 
  I am searching source code of android sample . I clone your git url but there is nothing. I need sample source code with is using your library . I am finiding that.10:51.45 
  Any one here who can help me10:51.54 
Robin_Watts Dhama: To be even clearer... Sharing the source code alone is not enough.11:03.48 
  Sharing the source code is one important part of the AGPL, but it's not the only requirement.11:04.11 
  You need to specifically license your entire app under the AGPL.11:04.40 
Dhama My Main Question :11:04.41 
  I am searching source code of android sample . I clone your git url but there is nothing. I need sample source code with is using your library . I am finiding that. [16:21] <Dhama> Any one here who can help me11:04.43 
Robin_Watts Right. Which app are you looking for specifically?11:05.08 
  All our code can be found here: http://git.ghostscript.com/11:06.02 
Dhama Link : https://mupdf.com/downloads/ this apk file code I need where it is : mupdf-android-viewer-mini-1.11-armeabi-v7a.apk11:06.25 
Robin_Watts Well, if you look on the link I just gave, you, it's pretty obvious :)11:07.07 
  Fifth line down: mupdf-android-viewer-mini.git11:07.39 
  4th line down, even.11:07.58 
Dhama Okay, What I need to do with my code for covered by the GPL ?11:09.17 
Robin_Watts But please, do take the time to read, understand, and abide by the license terms. We can, and will (and have in the past) taken legal action against people who have flouted the license terms.11:09.21 
  Dhama: Read the GNU AGPL. Abide by its terms. I am not a lawyer, and it's not my job to give you legal advice :)11:09.52 
Dhama Okay, Okay Thanks :)11:10.09 
  I am using your code and with help of that code I am opening PDF in my andorid application I need to pay how much to you guys ?11:10.41 
kens Under AGPL nothing11:10.53 
  If you want a commercial licence, then that's a different issue11:11.07 
Dhama Price of commercial licence ?11:11.22 
kens I can't answer that, you would need to talk to our sales people11:11.36 
Robin_Watts If you release your entire app under the AGPL (which will include giving all the source code etc away so that anyone else can rebuild it and modify it themselves), it's free, as kens says.11:11.36 
Dhama Okay okay11:11.58 
  Your sales person Email ID ?11:12.16 
Robin_Watts Commercial licenses are tailored to usage. They will be multiple thousands of dollars.11:12.22 
Dhama Is he in this thread ?11:12.26 
Robin_Watts sales@artifex.com11:12.33 
kens No, you want sales at artifex.com11:12.35 
Dhama Dont worry about your multiple thousands of dollars its not matter for me, My product is metter for me a lot11:13.10 
Robin_Watts Dhama: Cool. Then email sales@artifex.com, and Scott will get back to you.11:14.07 
Dhama Sales person is available in this thread ?11:14.31 
Robin_Watts Answer his questions as best you can, and he'll get you a tailored quote. The more information you can give him, the better he can tailor it.11:14.33 
  Dhama: No.11:14.41 
  By email - he should get back to you within 24 hours. If he doesn't, come back to us and we can chase it for you.11:15.06 
Dhama Okay, Great thanks for your time Robin , Kens and tor811:15.19 
kens NP11:15.37 
Robin_Watts best of luck.11:15.42 
sebras tor8: I think the idea was to have PDFDocument_save return an int because this is really a soft error.12:17.21 
tor8 what do you mean by "soft" error?12:17.38 
  all Java errors are handled as exceptions in the system frameworks12:17.52 
  failing to save is a pretty hard error as I see it...12:18.26 
sebras soft error in the sense that your code (not the library) manipulated the PDF document in such a way that it was unable to save the file12:18.30 
  the library decided not to fz_throw, so it is a separate type of error.12:19.09 
  if we fz_threw() then it would indeed be a java exception.12:19.28 
tor8 it did? pdf_save_document returns null...12:19.31 
  returns void12:19.40 
sebras yes, but pwo.errors might be > 012:19.47 
  this is the value that PDFDocument_save() returns.12:19.58 
  also GetStringUTFChars() doesn't necessarily throw even if it returns NULL.12:20.21 
tor8 huh. I wasn't even aware of pwo.errors existing until just now :)12:20.38 
sebras https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html states that it returns NULL if the operations fails, but that particular function does not have a THROWS: clause like e.g. NewStringUTF does int the documentation.12:21.01 
  tor8: I tried to deduce in what cases it is set yesterday but didn't go too deep.12:21.28 
  too much discussion with fred about other thing. :)12:21.36 
  tor8: seemed to me like if we fail to expand a stream or copy a stream in an object while saving we would errors++12:22.00 
  but there were some other cases too.12:22.04 
  if an stream is truncated apparently.12:22.53 
tor8 sebras: opts->continue_on_error seems to be the gating one12:22.53 
  maybe we should throw a special exception if pwo.errors is true rather than return an int anyway12:23.23 
sebras yes, and that can be supplied in the options argument to PDFDocument.save()12:23.27 
  tor8: if we do that, maybe we should fz_throw() in the library?12:23.45 
tor8 so if (errors) throw new PDFDocument.SaveException() or something like that12:23.56 
sebras tor8: I guess the question is whether the _number_ or _precense_ of errors is interesting while saving. I'd think precense is more important.12:24.32 
tor8 anyway, the GetStringUTFChars etc failures trigger java exceptions overriding any return value right?12:24.40 
sebras not necessarily.12:24.52 
  as I wrote above, this particular function may fail with NULL without throwing anything.12:25.05 
  I guess when that happens we could check whether an exception is throw and if not throw InternalError ourselves.12:25.35 
tor8 sebras: actually, according to the jni docs, it can't fail at all...12:26.10 
sebras I think that's appropriate because we are blaming the basic JNI interface which is implemented by the JVM, so having InternalError blame the JVM is apt imho.12:26.10 
  RETURNS:12:26.30 
  Returns a pointer to a modified UTF-8 string, or NULL if the operation fails.12:26.31 
tor8 ah, no, I just can't read the damn crappy formatting of the docs12:26.33 
sebras yeah, the typography is subpar.12:26.44 
  sub par? subpar? oh well..12:26.53 
tor8 so if it fails, we should throw a java exception rather than return 0?12:26.56 
  or check the implementation to see what it actually does12:27.11 
sebras that's my idea12:27.12 
  well, checking the implementation is a bit harder. we'd need to check both openjdk, oracle jdk, dalvik and presumably art.12:27.53 
  but we could call ExceptionCheck().12:28.08 
  maybe that was what you meant?12:28.13 
tor8 both. if ExceptionCheck return 0; else if (null) throw a new java exception.12:29.03 
  then return.12:29.14 
sebras yes, I like that.12:29.40 
tor8 presumably checking two ought to be enough to know what the implementation is supposed to do. one would hope they match each other in behavior.12:29.48 
sebras and we should then probably throw new java exception if e.g. we can't get the ctx. for the same reason.12:30.04 
  do you agree?12:31.12 
tor8 get_context already throws an exception12:31.28 
sebras oh yes, and so does from_PDFDocument.12:32.12 
tor8 we just check the ctx and then bail so we can propagate it to java12:32.27 
sebras I guess we could debate _what_ exception is being thrown, but it is more important that _something_ is thrown.12:32.36 
tor8 yeah. at least something gets thrown.12:32.46 
sebras it _was_ rather late last night, apparently my brain was momentarily sleeping at that point. :)12:33.22 
  so I'll go over the jni code yet again and look for JNI functions which may return on error without setting an exception and then throw InternalError.12:34.16 
tor8 Robin_Watts: in "Fix problem with spot shadings in isolated groups" I don't quite understand what you mean by components being "full"12:35.41 
  sebras: I'd also check the implementation of the JNI functions12:35.59 
Robin_Watts tor8: let me look.12:36.05 
tor8 and maybe write a wrapper if it's a common case12:36.11 
sebras tor8: yup, that was my idea too.12:36.32 
tor8 sebras: cool.12:36.59 
Robin_Watts tor8: In a subtractive space, when we clear a new pixmap, all the components need to be set to 0.12:37.31 
sebras I'll get back with a few patches later.12:37.37 
Robin_Watts In an additive space, when we clear a new pixmap, all the process components need to be set to 1 (i.e. full).12:37.58 
tor8 Robin_Watts: ah, so that's what you mean! fab.12:38.24 
  now I get it.12:38.26 
Robin_Watts Except that we have a new additive pixmap into which we are importing an alpha plane, so the process components aren't 1, they are 'alpha'. (1 * alpha = alpha)12:38.42 
tor8 yeah. I was having a spot of trouble parsing the grammar.12:39.00 
Robin_Watts tor8: yeah, I had to read it a couple of times :)12:39.13 
tor8 I read "full (scaled by alpha)" as something else12:39.21 
  full (definition of full: scaled by alpha)12:39.36 
  Robin_Watts: I am somewhat concerned by just how many different loops over pixmap data doing conversions we have12:40.51 
Robin_Watts I'm open to ideas for reducing them.12:41.29 
tor8 fz_copy_pixmap_area_converting_seps more specifically12:41.42 
  are the permutations a case of optimizing out branches in the inner loop?12:42.13 
  and it's all mixed up with #ifdefs too12:42.50 
Robin_Watts There are various different sections in that code.12:43.28 
  The first section deals with process colorants, either doing a quick simple copy, or by calling a pixmap converter.12:44.22 
  The second section is then to do with the spots. First we have to copy spots that appear in both pixmaps, then we have to map the ones that aren't in the destination down to process colorants.12:45.26 
  That mapping code has 4 loops for each of the cases (additive vs subtractive for source x destination)12:46.07 
  Then we have a separate set of loops for device_n, cos that's a different kettle of monkeys.12:46.40 
  And, yes, there is an ifdef in that last case.12:47.09 
tor8 and an if (0)12:47.18 
  with a label in the middle12:47.28 
Robin_Watts Yes.12:47.58 
tor8 I don't see any obvious fixes, but I'll still complain a bit :)12:48.07 
Robin_Watts If you can think of a nicer way to express that, I'm all ears.12:48.11 
tor8 I might take a look after the release is out12:48.22 
Robin_Watts We can experiment with removing the #ifdef once this is in.12:48.42 
  I'm always happy to see code simplified.12:49.35 
tor8 so looking at mvrhel's icc profile when loading image support12:49.58 
  he swallows any icc parsing errors and ignores them12:50.19 
  is that what we want to do?12:50.24 
Robin_Watts I think the idea is that we don't want to abandon an image load just because of a broken profile.12:50.44 
  Arguably we should fz_warn12:51.38 
tor8 I'm not thrilled about the fz_set_icc_bgr function call. I don't see it used anywhere, is it only used from gsview?12:51.58 
Robin_Watts Yes.12:52.06 
  That might get tweaked when we look at the enum for color types.12:52.32 
  cos presumably we'll have a BGR enum value there.12:52.46 
tor8 it seems like it should be part of the constructor somewhere12:53.13 
  either auto-detected or as a flag or something12:53.23 
  but I can't see how it's being called (as I don't have gsview.git checked out and it's not on git.ghostscript.com)12:53.51 
Robin_Watts tor8: yeah, it's in /home/mvrhel/private-repos/ I think.12:54.31 
tor8 I found one in /home/git-private/12:54.51 
  right, so the function forces an existing RGB profile to be BGR12:56.23 
  which makes me think it should throw an exception if it's not12:56.48 
  'Use embedded ICC profile when rendering PNG images' doesn't fz_warn on profile loading errors like the other image loaders12:57.47 
  and it's got awkward error handling and cleanup12:57.56 
  those two issues aside, robin/spots looks good to me12:59.02 
Robin_Watts tor8: cool. I'll grab some lunch.12:59.16 
  Do you want to tweak those issues, or shall I try later?12:59.26 
tor8 and maybe figure out a better name for fz_set_icc_bgr12:59.27 
  I can tweak the PNG icc profile loading12:59.37 
Robin_Watts ok. back in a bit.12:59.49 
sebras wtf?! according to the JNI spec ThrowNew may return < 0 if it is unable to throw an exception. what is the JNI code supposed to do in that case?! :-P13:16.47 
tor8 god damn it, the reference counting for colorspaces is still wrong everywhere...13:59.39 
Robin_Watts tor8: is it?14:00.01 
tor8 all the pixmap image loading that uses colorspaces do it wrong14:00.20 
Robin_Watts ah.14:00.28 
tor8 fixes on tor/spots14:01.26 
Robin_Watts will grab.14:01.36 
tor8 not tested on the cluster14:01.36 
  ah, I pushed a fix for the fix that makes it build too14:03.29 
  now I wonder how much else is wrong with colorspace reference counting...14:04.02 
Robin_Watts tor8: Yay! I've just produced a version of the first 50 pages of the pdf_reference guide with all the odd character codes removed.14:06.40 
  And all the other chars in the same places as before.14:06.52 
tor8 ah, this is the redaction stuff you're working on?14:07.37 
Robin_Watts yeah.14:08.02 
tor8 Robin_Watts: on tor/master there's a commit that adds some filtering fz_outputs14:08.17 
Robin_Watts tor8: ok, let me deal with the tor/spots stuff first :)14:08.38 
tor8 Robin_Watts: no worries.14:08.42 
  it's a WIP completely untested yet14:08.47 
  but our discussion last week made me curious to how it would look14:09.02 
Robin_Watts tor8: ok, robin/spots updated.14:21.04 
  If that clusters Ok, are we happy to commit it?14:21.11 
tor8 Robin_Watts: I believe so, yes.14:31.47 
Hufokus Hello guys19:03.37 
  Can't link my program with libmupdf.lib due to weird link error in "noto.obj": unresolved external symbol "fz_resources_fonts_urw_Dingbats_cff" and so on. But! libmupdf.lib was previously successfully built and linked correctly. Any directions where to dig?)19:08.50 
Robin_Watts Hufokus: That sounds like you're out of date with respect to the generated data,19:27.05 
  I'll bet you're building for android and you've just updated the source code, right?19:27.23 
Hufokus Robin_Watts, no, I'm building for Win, x64. Btw I deleted generated folder and rebuilt, and it didn't work19:44.41 
  case closed, thanks. Didn't add libfonts.lib to the linkage process >.<22:18.50 
 Forward 1 day (to 2017/10/25)>>> 
ghostscript.com #ghostscript
Search: