| <<<Back 1 day (to 2014/10/19) | 20141020 |
norbertj | kens: I saw the logs, and I checked our code. We indeed do use the first/last page in plmain. We have a mechanism in place to do pagerange printing which uses it. | 05:14.44 |
rayjj | norbertj: Do you use FirstPage LastPage with PCL, or only with PDF ? | 05:24.33 |
| norbertj: and I guess PS is similar to PCL in that it needs special handling with pdfwrite to avoid writing data for all of the pages prior to FirstPage or with rendering (or clist writing) to skip rather than process then erase. | 05:28.07 |
| writing the clist is probably the least onerous, in that 'erasepage' rewinds the clist file, but it still writes the clist for every page prior to the first before deleting the data | 05:29.13 |
| (actually I'm not sure that -dFirstPage > 1 even works for PS input) It is certainly possible to do using the setpagedevice /EndPage proc, but that *definitely* processes all the data for pages prior to FirstPage | 05:31.09 |
tomty89 | hmm i don't understand. why fontconfig can match the "standard names" like Helvetica and Courier with fonts here http://svn.ghostscript.com/ghostscript/tags/urw-fonts-1.0.7pre44/ but not those here http://git.ghostscript.com/?p=urw-core35-fonts.git;a=summary | 07:08.35 |
| when i use and editor to open the pfb, i don't see those names inside either of them | 07:09.05 |
| is it in binary form or something? | 07:10.19 |
kens | Yes, .pfb means Printer Font Binary. | 07:10.44 |
| However, the font names are not usually encoded | 07:11.13 |
tomty89 | yeah i can see the "urw names" in plain text | 07:11.33 |
| i am just curious if the new version will no longer map to those "standard names" | 07:12.08 |
chrisl | fontconfig isn't something we know about | 07:12.48 |
tomty89 | but do you know if the fonts in the git contains alias/mapping to names like Helvetica? | 07:13.47 |
chrisl | No, the fonts have *never* contained any mappings | 07:14.08 |
tomty89 | hmm | 07:14.17 |
kens | If battle returns for an answer to his question, Powershell is reporting it can't find gswin32c.exe, so I would suggest that either he installed the 64-bit version of GS (and hence the Perl script can't find the 32-bit version) or there is some other failure in his installation/configuration. He needs to look at ps2eps.pl, there's nothgin we can say to help. | 07:14.21 |
| norbertj thanks for the confirmation about FirstPage and LastPage | 07:14.39 |
chrisl | tomty89: in the case of Ghostscript, there is a Postscript configuration file (Fontmap.GS) which contains those mappings. I've no idea what fontconfig might be using | 07:15.07 |
kens | rayjj I don't believe that -dFirstPage and -dLastPage work for the PostScript itnerpregter atl all. In fact hey only work 'properly' for the PDF interpreter, and for rendering devices with the PCL interpreter. I'm hoping to get a consistent approach for all interpreters. | 07:16.07 |
tomty89 | chrisl: to be honest i am not very familiar with fontconfig, but when I put into system are the 105 files (from either svn or git), when it's from svn (older version), fontconfig will match/subsititue Helvetica, Courier with them correctly, when it's from git, it can't | 07:17.11 |
| chrisl: so there could only be two way, either the files from svn contains those names, or fontconfig have some hard-coded mapping, which i found quite impossible | 07:17.45 |
chrisl | tomty89: probably because the file names/font names have changed. | 07:17.55 |
| tomty89: at least some of the mappings are configured in the files in /etc/fonts/conf.d | 07:28.02 |
tomty89 | yes! | 07:28.21 |
| i just found out that too | 07:28.28 |
| how silly i am | 07:28.31 |
| chrisl: sorry to have bothered you, thanks a lot :) | 07:29.14 |
chrisl | tomty89: np | 07:29.20 |
| tomty89: remember if you change those mappings you *probably* need to tell fontconfig about it in some way (like rerun fc-cache - but don't take that as gospel!) | 07:31.21 |
tomty89 | right :D | 07:32.56 |
ara | hello | 07:34.43 |
ghostbot | Welcome to #ghostscript, the channel for Ghostscript and 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. | 07:34.43 |
Guest18702 | I have mailed to know regarding commercially using MuPDF in android app, but still no reply ... could anybody give me idea.. usually how many days they take to respond | 07:36.03 |
kens | It should be quick, but occasionally emails go astry, in either direction. I'll send a followup and ask, what's the company name ? | 07:37.07 |
Guest18702 | I have sent from my personal mail | 07:38.51 |
| mofajjal@gmail.com | 07:38.55 |
kens | OK I will ask sales if they have responded to you | 07:39.10 |
Guest18702 | sure please.. thanks a lot for your help | 07:39.22 |
kens | Given they are in the US, it will be several hours before we can expect a reply. | 07:40.54 |
Guest18702 | oh right.... | 07:41.53 |
kens | Either hang around, or read our logs later, and I'll put a reply here when I hear back | 07:42.20 |
Guest18702 | okay... im here for few more hours... | 07:43.07 |
| it would be nice to have few more idea.. | 07:43.15 |
kens | As soon as I hear I'll put a reply here. I would think you should expect an email from Scott Sackett as well | 07:43.49 |
| By the way, did you check your Gmail spam folder ? Sometimes it makes mistakes.... | 07:44.22 |
Guest18702 | I have checked earlier ... haven't got | 07:49.36 |
| checking again now | 07:49.40 |
kens | Fair enough, its possible it ended up in Scott's spam folder, he'll check now I've asked him | 07:50.00 |
Guest18702 | ohh.. .yah... good catch :) | 07:51.44 |
| i have checked my spam folder.. haven't find ny... | 07:51.56 |
kens | No Problem, just a thought. Made me clean mine up too, 275 messaegs :-( | 07:52.31 |
Guest18702 | yaah.... .. clean up time .. | 07:53.29 |
kens | Well, one of mine wasn't spam..... | 07:53.52 |
Guest18702 | hmmm.. | 07:54.39 |
kens | OK morning coffee time | 07:55.32 |
Guest18702 | ohh... okkay.... it smells fresh there... :) ... cofee... | 07:56.10 |
| i will hv lunch here now .. | 07:56.23 |
| :) | 07:56.23 |
| Hello Ken | 08:15.58 |
| u there | 08:15.59 |
| ? | 08:16.00 |
kens | Yes back now | 08:16.03 |
Guest18702 | I have found Vudroid wich is using gpl license | 08:16.30 |
| it's using MuPDF in source code as I can see | 08:16.52 |
kens | The name is vaguely familiar | 08:16.54 |
Guest18702 | https://code.google.com/p/vudroid/source/checkout | 08:17.11 |
kens | Hmm, says its currently not maintained | 08:17.26 |
sebras | kens: I have seen this before, I think vudroid is based on ebookdroid which used an older version of mupdf at the time. | 08:17.36 |
Guest18702 | yeah... | 08:17.46 |
| as the vudroid is GPL licsenced.. | 08:18.09 |
| it can be used freely | 08:18.18 |
| ? | 08:18.19 |
| just to have some idea from you :) | 08:18.30 |
kens | It can be used in a manner which conforms to teh GPL licence | 08:18.32 |
| MuPDF is also AGPL licenced (GPL and AGPL are very nearly the same) | 08:18.56 |
Guest18702 | hmm.. but in AGPL .. we have to open up our sources when somebody would want it | 08:19.33 |
| ?? | 08:19.34 |
kens | GPL is hte same | 08:19.42 |
| Pretty much all the open source licences require you to open your own source code | 08:20.07 |
Guest18702 | hmm... only the part that I use from other parties right | 08:21.02 |
| ? | 08:21.03 |
| or my full sources | 08:21.08 |
| ? | 08:21.09 |
| sorry for my ignorance in this part :( | 08:21.31 |
kens | If you use an open source piece of software you are required to release your own source for hte application which uses the open source software. | 08:21.39 |
| Open source is not the same as 'free' | 08:21.55 |
| The primary original reason for open source waqs so that people could take the source and modify it for their own needs. The reason it 'infects' applications using it is so that anyone who modifies the source should be able to rebuild the application which uses that source as well. | 08:23.11 |
| FOr example, there's not much point in my being able to modfy the zlib source, if I can't recompile MuPDF to use *my* version of zlib instead of the stock one. | 08:24.09 |
Guest18702 | yaah... thanks .. | 08:24.37 |
| so If I use Vudroid .. without doing any modification to their source code.. i woun't have to open up my full source | 08:25.07 |
| ? | 08:25.08 |
kens | Yes you will | 08:25.17 |
| Its still GPL source code | 08:25.23 |
Guest18702 | hmm.... yaah... | 08:25.31 |
kens | SO you have to abide by the terms of the GPL | 08:25.36 |
Guest18702 | right... i see .. i have to do some study on those things.. | 08:25.52 |
| thanks for your knowledge sharing | 08:25.58 |
| :) | 08:25.59 |
kens | Be aware I am not a lawyer, treat my musings with caution..... | 08:26.19 |
chrisl | The language of the (A)GPL is fairly clear (for a legal document!) and not too hard to understand, so it's worth having a read of it | 08:26.55 |
Guest18702 | yahh... | 08:27.20 |
chrisl | And I say that as someone who has *very* little patience with legalease! | 08:28.20 |
Robin_Watts | Guest18702: How long ago did you mail Scott ? | 08:32.55 |
kens | Robin_Watts : I already sent Scott an email and CC'ed Miles | 08:33.19 |
Guest18702 | few hours ago.. | 08:33.23 |
| I have sent mail to sales@... | 08:33.43 |
Robin_Watts | Guest18702: Jeez. And you're complaining that he hasn't responded already? | 08:33.49 |
kens | sales@ is an alias | 08:34.02 |
Guest18702 | it's not complaining... just asked usual response time :) | 08:34.13 |
| yeah... still waiting for response | 08:34.33 |
Robin_Watts | Guest18702: Scott is on Texas time, so you can expect him to reply within a working day. | 08:34.56 |
| hence he won't be up until later today. | 08:35.06 |
Guest18702 | okkay... no problem .. thanks for the clarification | 08:35.21 |
Robin_Watts | He is generally quite good at replying to people quickly. | 08:35.34 |
Guest18702 | in fact you all r cordially helpful | 08:35.59 |
| so far | 08:36.05 |
| :) | 08:36.06 |
jogux | tor8 (etc): ios mupdf 1.6 got approved by Apple btw, went on the store sometime yesterday | 09:57.45 |
tor8 | jogux: fab, thanks! | 10:18.28 |
henrys | chrisl: did you do the PrinterName stuff in xps? Any idea how marcosw is getting http://bugs.ghostscript.com/show_bug.cgi?id=695617 without specifying the PrinterName? - I can't reproduce it. | 13:43.45 |
kens | henrys I have to apologise, I'm going to miss tomorrow's IRC meeting. I foolishly made an appointment to give blood without realising it was for a Tuesday. | 13:45.18 |
henrys | kens: np | 13:45.34 |
kens | I'll read the logs when I get back home | 13:45.50 |
chrisl | henrys: no, that was kens | 13:50.04 |
kens | Oh oh :-( | 13:50.11 |
| I don't remember doing anything like that...... | 13:50.28 |
chrisl | xpsprint | 13:50.42 |
kens | Still a blank :-) | 13:50.57 |
| But if Marcos is running on Linux, I thought all that would be #ifdef'd out | 13:51.31 |
chrisl | It should b | 13:51.43 |
| e | 13:51.45 |
henrys | no I verified the parameter is parsed on linux, but like I said I don't see his issue. He shouldn't get to the error without specifying a parameter with length > 64 | 13:52.50 |
kens | xps_put_params doesn't have it with a #ifdef | 13:52.51 |
| It shoudl be protected | 13:53.02 |
| same for get_params of course | 13:53.21 |
henrys | kens: I agree but that would possibly mask the issue. | 13:53.28 |
chrisl | Nevertheless, as henrys says, the command line doesn't set PrinterName, so...... | 13:53.51 |
kens | Well, more than mask it, it shouldn't be handling the parameter on anything except Windows | 13:53.57 |
| Yeah, that is a puzzler | 13:54.08 |
henrys | yes if marcos is seeing something it suggests an indeterminism somewhere. | 13:55.14 |
| perhaps it should be persistant. rayjj is "parameter man" I'll ask him before I fish throught the horror | 13:55.58 |
kens | I wonder if the PrinterName is not initially set to NULL ? | 13:56.00 |
| in the device structure | 13:56.17 |
| Because we return xps->PrinterName from get_params, and so it will be reflected in the next put_params | 13:56.58 |
henrys | kens: I would think size 0 would cause a 1 (not found) return but maybe not | 13:57.51 |
kens | If the pointer is uninitialised, what will we return ? :) | 13:58.10 |
| Oh its not a pointer | 13:58.32 |
henrys | code == 1 | 13:58.41 |
| verified that just now in the debugger. I go to case 1: for marcosw command line | 13:59.11 |
kens | henrys is the PrinterName fully initialised to 0 ? Even on a release build ? I can't at the moment see where that gets done | 13:59.38 |
| If it has MAXPRINTERNAME bytes, none of which are 0, then it would be a problem. | 14:00.03 |
chrisl | There's least one oddity: line 845 in gdevxps.c | 14:00.21 |
henrys | kens: I think I saw garbage let me run again | 14:00.23 |
kens | henrys, garbage would be bad. THat would explin the problem, and its being non deterministic | 14:00.43 |
| chrisl, yes that line is the one that concerns me. | 14:01.32 |
| THe structure doesn't contain a pointer, its a static array of chars | 14:01.43 |
chrisl | Yes, but we return PrinterName and the length of fname..... | 14:02.00 |
henrys | kens: I have NULL's but I don't see an initalization. | 14:02.11 |
kens | Oh that looks even worse ;-) | 14:02.15 |
henrys | kens: but the size is 0 so who is looking at the data? | 14:02.33 |
kens | henrys, see line 845 | 14:02.43 |
| That's not right. | 14:02.48 |
| Shoujld be xps->PrinterName, not xps->fname | 14:03.02 |
henrys | ahah | 14:03.20 |
kens | IIRC Marcos did specify a long output filename | 14:03.25 |
chrisl | It still looks like PrinterName is potentially uninitialised..... | 14:04.06 |
henrys | chrisl: it is. I'll fix it. | 14:04.21 |
kens | That was my first concern | 14:04.21 |
| henrys you should fix line 845 too | 14:04.31 |
chrisl | henrys: it'll mean extending xps_device_body() significantly :-( | 14:04.52 |
kens | I suspect that's the real cuplrit, but initialisation is essential also | 14:04.55 |
Diemex | In what unit is the page size returned by mupdf on android? I'm getting 1194|1684. Is it px, dpi, pts? I would like to have a real world unit like millimeters or inch. | 14:05.07 |
kens | chrisl as long as the first byte is 0, its fine, because its a C string | 14:05.24 |
| Diemex, the easiest way to tell is probably to see how big the PDF page you are using is | 14:05.53 |
chrisl | kens: yes, but xps_device_body() doesn't currently contain any of the xpswrite specific values, and PrinterName is the last of those | 14:06.10 |
kens | Oh yuck. | 14:06.18 |
| And because (as I've ranted about before) we call get_params/put_params before we call open, it has to be initialised by the structure descriptor | 14:06.54 |
chrisl | Yes, and there may be default vector device entries in between, too | 14:07.12 |
Diemex | kens: How big? Isn't that supposed to be the size? I would like to know if it's an A4, letter or whatever size. I could figure that out by the aspect ratio but I cant tell if its A1, A2, A3 or A4 just by aspect ratio | 14:07.36 |
kens | Diemex, your PDF file has a MediaBox, right ? SO what is it ? | 14:07.51 |
| If you look at that, then compare it against the values you get from MuPDF you can likely figure out what the units are yourelf. | 14:08.20 |
Diemex | kens: How do I get the mediabox? I'm basing my code of the mupdf example. There is just a method for get page size. | 14:08.49 |
| I'm not that fluent in c so I havent digged around in the native source yet | 14:09.04 |
kens | Opent het PDF file you are using to test with, look for MediaBox | 14:09.05 |
| More specifically; open the PDF file you are testing with in a text editor and search for MediaBox | 14:09.42 |
Diemex | MediaBox [0 0 595.276 841.89] | 14:10.08 |
| mediabox is in pts right? | 14:10.19 |
kens | Yes, it is | 14:10.27 |
Diemex | So how do I get the mediabox with mupdf in java code? | 14:10.40 |
kens | SO you are getting ~2x that returned from MuPDF | 14:10.43 |
| Diemex, no idea, you'll need one of the MuPDF developers | 14:10.57 |
| I was hoping it would be in PostScript/PDF units (ie points), but that looks more like pixels | 14:11.24 |
Robin_Watts | Diemex: The MuPDF API is a C level one. | 14:11.57 |
kens | was just typing that..... | 14:12.05 |
Robin_Watts | We have some classes that wrap the C to expose some methods to java as part of the android viewer, but that exposure is far from systematic/complete. | 14:12.46 |
| We have basically exposed exactly as much as we need for the purposes of the android app and no more. | 14:13.12 |
Diemex | How do I add more exposure? | 14:13.22 |
Robin_Watts | As such there is no 1:1 correspondence between the java API and the C one. | 14:13.36 |
Diemex | Is the pagesize always 2* the mediabox? | 14:13.38 |
Robin_Watts | Certainly not. | 14:13.53 |
Diemex | Then I need a method for the media box | 14:14.04 |
Robin_Watts | When you call the getPageSize method (whatever it's called, I forget), you will almost certainly be asking the MuPDF java classes what size it thinks the page is as a view (or at the current pagezoom or something). | 14:14.59 |
| You can't trust that getPageSize at the java and the C level are going to give the same results without checking the JNI code. | 14:15.29 |
| The JNI code is contained in platform/android/jni/mupdf.c | 14:15.45 |
| You'd need to check in there, and maybe add new methods. | 14:16.06 |
Diemex | Offtopic: Why is it written in c and not c++? Isn't it hard to write it in c? | 14:16.50 |
Robin_Watts | I have some prototype code that offers a proper exposure of the MuPDF C API into Java. | 14:16.54 |
| Diemex: WTF? | 14:17.10 |
| C++ is the work of the devil. | 14:17.36 |
kens | A very incompetent devil | 14:17.50 |
| Possibly even a committee of devils | 14:18.00 |
Diemex | hahaha I'll have to say that to my professor doing c++ | 14:18.13 |
| Robin_Watts: Where can I find the prototype code? | 14:18.37 |
Robin_Watts | C++ is like a swiss army knife you have to use with all the blades open at once. | 14:18.45 |
| It's possible to get the job done, but you will cut yourself. | 14:18.55 |
tor8 | s/cut/maim/ | 14:19.52 |
| if you're going to use C++, don't forget to renew your tetanus shot | 14:20.45 |
Robin_Watts | Diemex: http://git.ghostscript.com/?p=user/robin/mupdf.git;a=shortlog;h=refs/heads/jni2 | 14:21.37 |
| It's all horribly untested. | 14:21.51 |
| It's a background project I do on long haul flights. | 14:22.10 |
henrys | kens, chrisl : can we use dev->is_open to look at the parameter and initialize in open? | 14:25.50 |
kens | henrys no | 14:26.00 |
| Because get_params and put_params are called *before* the device open method | 14:26.17 |
henrys | kens: yes but they are called again after before the job. | 14:26.49 |
kens | So the device initialiser needs to ensure that the values are properly (or at least, safely) initialised before open gets called | 14:26.52 |
Diemex | So I would open a Pdf with Document(string filename) and then getPage(int). The methods for pagesize and mediabox are sadly missing though. | 14:26.58 |
kens | henrys yes, but if the data is indeterminate, you could get an error before you get to the open | 14:27.11 |
| Consider; get_params returns a bonkers string which has no NULL, the C stgrelen of that string is > 64 bytes. THat gets stored as a PostScript name object in the page device. When we next call put_params, it ssends that name, the length is > 64 bytes so we throw an error. We have no yet reached the open routine..... | 14:28.21 |
| I'm not *certain* that's a possible scenario mind you, but I think it may be | 14:29.01 |
Robin_Watts | Diemex: Page.bound | 14:30.23 |
| That'll return mediabox I think. | 14:30.44 |
Diemex | that is the mediabox or the pagesize? | 14:30.44 |
henrys | kens:in xps get and put params, if the device in't open we goto case 1 - parameter not found. | 14:31.50 |
Robin_Watts | Diemex: In fact, checking the code I see it's PageSize | 14:32.13 |
| Well, it's the results of fz_bound_page | 14:32.53 |
henrys | we should have initialization before get and put though, that's crazy. | 14:33.04 |
kens | refers henrys to my previous statements on the matter :-) | 14:33.29 |
Diemex | What ide are you using for c? I'm just using a texteditor and it's taking forever to find the c-method for the mediabox. I just want to add a java method. I only need the mediabox and rendering of pages for the moment. | 14:34.02 |
kens | let me look at the file again..... THere was a commented out initialiser in there. | 14:34.12 |
Robin_Watts | Diemex: I use emacs, or MSVC. | 14:34.21 |
kens | Diemex : I use Visual Studio | 14:34.29 |
Diemex | I'm on linux and I have tried like every possible ide. The only one that didn't outright suck was netbeans. | 14:35.10 |
| and sublime text of course | 14:35.29 |
kens | henrys I suppose we could refuse to add PtinerName to the parameters if we have no yet been through open, by checking is_open, but you would have to make sure we don't try and set PrinterName before we do _open() I have a suspicion we do (in the PostScript worl anyway) | 14:36.03 |
tor8 | Diemex: ctags and/or cscope is your friend | 14:36.26 |
Robin_Watts | Diemex: All IDEs suck. | 14:36.38 |
| MSVC is the least sucky I've found. | 14:36.49 |
nsz | tor8: it seems Math.min.length is a lie, i wonder if there are other similar cases or how to work it around | 14:37.41 |
kens | henrys I can't see a guaranteed reliable way to do the initialisation unless you setup the initialisers properly in the device when it is declared. | 14:37.46 |
tor8 | nsz: according to the spec it should be 2, but the length property of a function is only advisory | 14:39.31 |
kens | Robin_Watts: If ara comes back, Scott has replied to his email. | 14:39.52 |
nsz | yes but min should be able to differentiate between undefined arg and no arg | 14:40.02 |
| i wrote a mail about this issue | 14:40.11 |
henrys | kens: we could use a static global. | 14:40.33 |
kens | runs away screaming | 14:40.42 |
Robin_Watts | trusts henry is joking. | 14:40.57 |
henrys | don't be snobs | 14:41.15 |
tor8 | nsz: I haven't got any mail from you lately | 14:41.16 |
kens | Write 100 times "globals are bad" | 14:41.18 |
nsz | :( | 14:41.22 |
Robin_Watts | henrys: How much work did I do to remove globals from the code? | 14:41.40 |
kens | henrys it'll come back and bite us I very strongly suspect | 14:41.42 |
tor8 | nsz: js_gettop can be used to check if an argument is 'undefined' or not passed | 14:42.07 |
kens | reiterates; our device interface is terrible, we hsould rewrite it | 14:42.23 |
henrys | yeah it's not good. | 14:42.28 |
nsz | i'm not sure if the c api needs modification: min has to know if min() or min(undefined) was called, but the jsR_call.. fills up the stack with lenght number of undefined args | 14:42.33 |
henrys | who is sending that first set of get and put params exactly? | 14:42.54 |
kens | In the PostScript itnerpreter ? | 14:43.09 |
henrys | this is before the device procedures are even filled in. | 14:43.10 |
| ? | 14:43.11 |
kens | henrys, no the device procs are filled in by the device initialiser | 14:43.22 |
Robin_Watts | I'm going to regret asking this, but what is the problem here? That devices can be called to get/put params before they are 'opened' ? | 14:43.24 |
kens | Robin_Watts : that's 'part of' the problem | 14:43.39 |
tor8 | nsz: so min() and min(undefined) would have different gettop | 14:43.47 |
chrisl | Robin_Watts: before *any* device specific initialisation happens | 14:43.52 |
kens | THe xpswrite device only has a partially initialised declaration | 14:43.56 |
tor8 | or my memory of how this works is too fuzzy :/ | 14:43.59 |
nsz | tor8: no, gettop is the same | 14:44.02 |
henrys | kens: initially yes but then we do gx_device_fill_in_procs() ... | 14:44.11 |
nsz | jsR_call.. fills up the arg stack | 14:44.13 |
| with undefineds | 14:44.22 |
Robin_Watts | kens: Something has to malloc the gs_device struct, right? | 14:44.34 |
nsz | so Math.min(1,undefined) and Math.min(1) looks the same | 14:44.43 |
kens | Robin_Watts : yes, and IIRC it does not set it to 0 | 14:44.47 |
Robin_Watts | Can we not arrange for that to clear memory? | 14:44.50 |
tor8 | nsz: right, we fill it up with undefineds otherwise temporary stack values could clobber unsupplied arguments | 14:44.55 |
nsz | (first should be NaN the second 1) | 14:44.56 |
kens | Robin_Watts : we could do certainly | 14:44.59 |
| But.... | 14:45.09 |
Robin_Watts | And would that solve the problem? (Or provide a way of solving the problem?) | 14:45.13 |
henrys | kens: so the size of your array will be an int in the struct. | 14:45.24 |
tor8 | nsz: just do Math.min.length = 2 | 14:45.27 |
nsz | ? | 14:45.38 |
kens | The code which does the allocation is (I think) alloc_struct, and I don't think we want to slow the code down by zero allocating every struct | 14:45.47 |
tor8 | nsz: the underlying length (in the cfunction object) would still be 0, but javascript will see 2 | 14:45.56 |
Robin_Watts | So we define a calloc_struct and call that instead? | 14:46.01 |
nsz | ah | 14:46.04 |
| if you can do that then that's ok | 14:46.25 |
tor8 | I don't think this is anything that would affect anything other than this one case | 14:46.28 |
Robin_Watts | or an alloc0_struct if you prefer. | 14:46.33 |
kens | Robin_Watts : Off the top of my head I'm not sure how feasible that is. Obviously its possible, I'm just not certain how much rewiring would have to be done. | 14:46.37 |
Robin_Watts | kens, chrisl: Either of you done much fiddling with opentype fonts? specifically the GSUB tables therein? | 14:47.19 |
Diemex | What is the difference between updatePage and drawPage? I have noticed that when I call drawPage twice on the same page the second bitmap is empty. Using updatePage always draws the page. | 14:47.33 |
kens | Robin_Watts : I have messed with them, but not recently | 14:47.47 |
chrisl | Robin_Watts: not that I recall... I guess I must have looked at them, but.... | 14:48.17 |
kens | thinks GSUB are TrueTyhpe though | 14:48.20 |
Robin_Watts | Diemex: You are expecting sanity from calling an API you are not supposed to be calling. | 14:48.23 |
| GSUB is the crux of what makes opentype 'better' than TrueType, I think. | 14:48.54 |
| along with SPOS. | 14:48.58 |
Diemex | Well not really I'm still using the code that is used by the mupdf android application. I just stripped it down. | 14:49.00 |
Robin_Watts | along with GPOS. | 14:49.01 |
tor8 | nsz: yeah, the 'length' property on the js object is just set for javascript's convenience, it is not used internally | 14:49.05 |
Diemex | I was just wondering if it's intended | 14:49.17 |
Robin_Watts | Diemex: Right, and thats not code for public consumption. | 14:49.18 |
tor8 | nsz: so setting that won't affect js_call's padding with undefined | 14:49.24 |
kens | Robin_Watts : IMO hte support for CFF is what makes OpenType 'better' :-) | 14:49.28 |
Robin_Watts | Diemex: I couldn't tell you offhand. | 14:49.34 |
kens | Oh yes GSUB is the glyph substitution table | 14:49.48 |
Robin_Watts | indeed. | 14:50.23 |
kens | Its a big winner for Arabic because the glyph has up to 3 shapes depending on what other glyphs are around it | 14:50.26 |
| I think Hebrew has a similar system | 14:50.35 |
tor8 | nsz: yeah, your mail was caught in the spam trap... google's spam filter has become unusually aggressive about flagging spam these last couple of weeks | 14:51.20 |
henrys | kens, Robin_Watts that could easily be done in gs_copydevice2, but it's ugly. Be much nices to let gx_device_init() call a devices init procedure. add another procedure to the device structure. | 14:51.22 |
Diemex | Oh and a totally off topic question regarding gpl/agpl. I have noticed that some closed source applications include mupdf. They don't bundle it in the app store. Instead they download it afterwards and only distribute the code of their mupdf module. Doesn't the whole app have to be gpl? | 14:51.55 |
kens | henrys many devices already have an init function. UIMO the correct solution is to open the device before we call anything from it. | 14:52.03 |
| s/UIMO/IMO/ | 14:52.12 |
Robin_Watts | henrys: AIUI the discussion (and I've just been picking up random bits here, so I may be way off), the problem is that the PS spec states when devices shall be 'inited' and 'opened' etc. | 14:52.24 |
kens | Diemex : essentially, yes. I suspect we would be interested in knowing who isn't following that. | 14:52.52 |
Robin_Watts | So we could possibly introduce a new device entrypoint and call that, but we'd have to call it something other than 'init'. | 14:52.54 |
| Possibly 'instantiate' or 'preinit' or 'birth' or something. | 14:53.15 |
chrisl | No, the real problem is our broken implementation of setpagedevice...... | 14:53.34 |
kens | Hmm,wife having hysterics downstairs, I wonder if this is the London trip...... | 14:53.58 |
nsz | tor8: good to know that google can mark me spam.. | 14:54.01 |
Robin_Watts | Diemex: It's all down to how you interpret the GNU AGPL/GPL and what it means by 'linking' and 'derived work'. | 14:54.01 |
kens | Robin_Watts : did you want to talk about the GSUB table ? | 14:54.35 |
henrys | anyway right here in copydevice gsdevice.c:364 we can call an initializion procedure, if the device has it set in it's structure. | 14:54.36 |
Robin_Watts | kens: I'm staring at the SOT code to handle it now. | 14:54.57 |
henrys | anyway let's talk to rayjj about it, that's his neck of the woods | 14:55.23 |
Robin_Watts | but I don't quite have it clear enough in my head to be able to ask coherent questions about it. | 14:55.24 |
kens | Robin_Watts : OK well if you want to discuss it, let me know | 14:55.51 |
Diemex | I have been very attentive when it comes to gpl. Recently craftbukkit got dmca'd. Craftbukkit was a lgpl api implementation of a gpl api. The gpl api was bundled with closed source. One of the developers of the bukkit api didn't like that and the whole project got taken down. | 14:55.52 |
Robin_Watts | kens: Ta. | 14:55.56 |
kens | THoguh I may have to refresh my memory as well | 14:56.01 |
tor8 | nsz: agh, Math.min.length is initialized to readonly :/ | 14:56.19 |
nsz | hehe | 14:56.34 |
tor8 | nsz: might need to make an auxiliary js_newcfunction then | 14:57.16 |
kens | Hmm, I wonder what I was doing an hour back.... | 14:57.24 |
Diemex | Robin_Watts: mupdf is agpl right? So that would even force you to publish the source if you used mupdf on a webserver? | 14:57.34 |
henrys | kens: oh you can't open the device first. | 14:57.44 |
Robin_Watts | Diemex: Yes. | 14:57.48 |
kens | henrys, why not ? I don't recall offhand | 14:57.56 |
henrys | kens: well you need all the parameters - output file name, buffersizes ... | 14:58.20 |
kens | Hmm, maybe we need a device 'create' routine then | 14:58.38 |
| With a separate open method for actually opening it | 14:58.52 |
henrys | kens: yeah like a constructor | 14:58.58 |
chrisl | I think the "init" method is the way to go.... | 14:59.15 |
kens | henrys essentially yes. Its been a PITA to have to set everything up in the declarations rather than in a C function | 14:59.28 |
| chrisl I don't mind what we call it :-) | 14:59.42 |
| Though as I've said before I would also favour removing *all* device specific data from the device structure and adding a single 'device_specific_data void * to hold all device_specific variables. | 15:01.27 |
tor8 | nsz: there is a fix on tor/master | 15:01.48 |
Robin_Watts | kens: That would be a MASSIVE rewrite. | 15:02.01 |
kens | Robin_Watts : I'm aware of that, but I think it owuld be worth it | 15:02.16 |
Robin_Watts | A systematic one, that might produce nice results, but nonetheless a massive rewrite. | 15:02.29 |
| Ghostscript X :) | 15:02.33 |
kens | At the same time we could remove the device methods which are now pointless | 15:02.34 |
| Hmm, do you suppose that's why the new WIndows is '10' not '9' 10 == X ? | 15:02.53 |
| Windows/X | 15:03.02 |
tor8 | nsz: the other (cleaner) option is to ignore the spec and let Math.min.length = 0 as it should be | 15:03.20 |
kens | I've just encountered a device method which is just crying out to be a spec_op instead of a device method. The only device which uses it is pdfwrite, yet every single devcie has to have a mthod for it :-( | 15:04.33 |
| Of course, most of the real ones are NULL | 15:04.57 |
| NB Thre's either an incorrect omment or incorrect memory usage in gsicc_cache.c, gsicc_transform_named_color() where it says: | 15:06.44 |
| profile pointer is not GC'd */ | 15:06.44 |
| namedcolor_table = | 15:06.44 |
| (gsicc_namedcolortable_t*) gs_malloc(pis->memory->stable_memory, 1, | 15:06.45 |
| sizeof(gsicc_namedcolortable_t), | 15:06.45 |
| "gsicc_transform_named_color"); | 15:06.46 |
| stable_memory is not the same as non_gc_memory..... | 15:07.08 |
chrisl | Is the memory persistent, or does it only last for the function? | 15:08.03 |
kens | oops I closed the file, just a mo | 15:08.15 |
| Its actually in 'namedcolor_table, which is stored somewhere else, so I'm having to chase it | 15:09.06 |
| namedcolor_table gets stored in named_profile, which I'm pretty sure is persistent | 15:10.02 |
nsz | tor8: yes it shouldnt break much code, but it's one of those cornercases that is actually properly specified | 15:10.58 |
chrisl | kens: Well, I'd suggest we get Michael to review it, but that probably won't happen while he's beholden to the SOT god..... | 15:11.03 |
kens | Though I have to admit I can't see wqhere named_profile is used ot returned | 15:11.06 |
nsz | btw does google write anything about the spam decision into the mail header? | 15:11.20 |
kens | chrisl, yes I intended to get Michael to look at it, I ran across it by accident at the weekend looking for somethign else. | 15:11.29 |
nsz | it would be good to know how to avoid such issues.. | 15:11.59 |
tor8 | nsz: not anything more than the eminently useless "It's similar to messages that were detected by our spam filters." message that it uses for everything | 15:13.38 |
nsz | i see | 15:13.56 |
henrys | chrisl, kens:I'm puzzled why ray doesn't have a problem with FirstLine and LastLine in gdevbit.c - looks like ti should be broken also. | 15:15.08 |
kens | gdevbit doesn't properly use the device constructors, it has to be specially hadnled each time we change the deive structure, let me look again. | 15:15.44 |
chrisl | henrys: possibly because they're just integers | 15:17.51 |
kens | Well it looks like he potentially ought to but.... THe thing is that it doesn't matter what initial value those numbers take, provided that they *are* set | 15:17.56 |
henrys | right I guess he doesn't actually use them untl after the put params, so it's okay but not pleasant ;-) | 15:18.46 |
kens | As long as they *are* set yes that's true | 15:18.57 |
| But if they are not, then I don't htink he can rely on them being 0, which he seems to | 15:19.10 |
chrisl | henrys: actually, they maybe be set by the declaration of gs_bitrgbtags_device | 15:19.20 |
kens | Its possible, much of the initialisation of trhe device isn't commented. | 15:20.27 |
chrisl | Although, that's only one instance of the bit device, so...... | 15:21.07 |
norbertj | rayjj: we only use firstpage/lastpage for pcl/xps interpreters. | 15:40.06 |
Diemex | So I tried to add a method for getting the mediabox and failed. It crashed on start. The logcat isn't particularly helpful. | 15:46.36 |
| Oh dang I didn't save the file | 15:47.10 |
kens | mvrhel_laptop : THere's a commetn earlier in the logs for you, at about 16:05 | 15:47.15 |
| Possible problem in gsicc_cache.c | 15:47.35 |
henrys | kens: it would be good to get something temporary so marcos can continue testing. If it's only to do with windows anyway ... | 15:47.37 |
mvrhel_laptop | kens: ok | 15:47.54 |
kens | henrys, just wrap the parameters with teh magic windows #ifdef | 15:47.58 |
henrys | okay | 15:48.11 |
kens | That shoudl be like that anyway, though you are correct it 'hides' the real problem | 15:48.32 |
mvrhel_laptop | kens: yes. something odd about that. will wrap up sot thing here first then take a closer look | 15:50.30 |
kens | mvrhel_laptop : there's no rush, but either the comment is wrong, or the allocator is, I haven't had enough time to figure out which yet. | 15:51.09 |
Diemex | So this is what I changed and it crashes http://pastie.org/9663197 | 15:52.06 |
Robin_Watts | kens: Is it just me, or are the OpenType specs dire? | 16:11.44 |
kens | Robin_Watts : they are better than the TrueType spec | 16:11.56 |
mvrhel_laptop | kens: yes there are issues with the memory and namedcolor profile. This code is so infrequently used we never stumbled across the issue. | 16:13.15 |
| I will fix it now | 16:13.24 |
kens | mvrhel_laptop : that's great thanks ! Its nice to get memroy problems fixed before we encounter them :-) | 16:13.46 |
| Hmm, rereading the GSUB documentation, I thought I had remembered it as harder than it is, turns out my memory was correct. | 16:14.36 |
Robin_Watts | You are correct in thinking that it is harder than it is? | 16:15.28 |
| by induction that means it's very hard indeed. | 16:15.37 |
kens | No, I was incorrect in thinking my memory of it being hard was wrong | 16:15.42 |
| It really is hard | 16:15.50 |
Diemex | Robin_Watts: What is wrong with my JNI code? | 16:15.56 |
Robin_Watts | Diemex: No idea. Haven't got time to look, sorry. | 16:16.08 |
kens | The only time I looked at GSUB was for Arabic text, I'm not certain I ever got to the bottom of it. | 16:16.41 |
| It was all a long time ago now | 16:16.53 |
| OK so all 74 functions written, and the code even compiles. I guess I'll find out what breaks tomorrow. | 16:17.37 |
| Night all | 16:17.41 |
Robin_Watts | night kens. | 16:17.50 |
Diemex | gnite | 16:17.59 |
| Robin_Watts: It's only 16 lines you might see the error right away | 16:20.05 |
Robin_Watts | you are returning an fz_rect from C and expecting that to magically become a RectF in java. | 16:21.07 |
| That won't work. | 16:21.13 |
| You need to make a RectF object in the C, and populate it there. | 16:21.29 |
| so the C function will return a jobject | 16:21.46 |
| clazz = (*env)->FindClass(env, "android.graphics.RectF"); | 16:22.30 |
| 2965if (clazz == NULL) | 16:22.32 |
| 2966fz_throw(ctx, FZ_ERROR_GENERIC, "Page.bound failed"); | 16:22.34 |
| 2967cons = (*env)->GetMethodID(env, clazz, "<init>", "(FFFF)V"); | 16:22.36 |
| 2968if (cons == NULL) | 16:22.38 |
| 2969fz_throw(ctx, FZ_ERROR_GENERIC, "Page.bound failed (2)"); | 16:22.39 |
| 2970jrect = (*env)->NewObject(env, clazz, cons, rect.x0, rect.y0, rect.x1, rect.y1); | 16:22.41 |
| 2971if (jrect == NULL) | 16:22.42 |
| 2972fz_throw(ctx, FZ_ERROR_GENERIC, "Page.bound failed (3)"); | 16:22.44 |
| something like that: See http://git.ghostscript.com/?p=user/robin/mupdf.git;a=blame;f=platform/android/jni/mupdf_native.c;h=10dc5a87a831302eac8aee6549834571bd36a2b1;hb=ccdf63db3f287056ad66adfc87a498d39614a606 lines 2964->2973 ,but you can't fz_throw. | 16:23.10 |
Diemex | what should I use instead of fz_throw? | 16:24.17 |
Robin_Watts | Diemex return a NULL pointer, and check for the returned java object being non null | 16:25.41 |
Diemex | return NULL; ? would fzthrow crash my app? | 16:26.30 |
mvrhel_laptop | crap. the named color profile structure appears to have no release procedure. not sure how that one slipped through the cracks | 16:26.48 |
Robin_Watts | Diemex: You can't call fz_throw without being inside an fz_try. | 16:28.18 |
| so yes, it would crash. | 16:28.28 |
Diemex | Robin_Watts: I can't get it to work. http://pastie.org/9663197 I think I might want to use a java only lib like iText to get the mediaboxes instead | 16:44.55 |
Robin_Watts | Diemex: Eh? | 16:45.18 |
| That looks unchanged. | 16:45.22 |
Diemex | Robin_Watts: Sry wrong link http://pastie.org/9663280 | 16:46.01 |
Robin_Watts | That looks good. What do you see when you run it? | 16:46.30 |
| If it's crashing, I bet it's because you haven't loaded the page before you try to find it's bbox. | 16:47.10 |
Diemex | Robin_Watts: The issue is I get a bunch of memory dumps with hex codes all over the place. | 16:47.49 |
Robin_Watts | Right, it's crashing. | 16:48.02 |
| So you need to do some debugging with LOGE(); | 16:48.46 |
Diemex | Here is a snippet of what I get http://pastie.org/9663288. It's so long it overflows my terminal | 16:50.09 |
Robin_Watts | What do you want me to tell you? | 16:52.32 |
| Yes, it's crashing. | 16:52.35 |
| You need to find out why. | 16:52.42 |
| If it was me, I'd put some LOGE's in there to see how far it's getting before it crashes. | 16:52.59 |
| I suspect the problem is with the glo->pages[pageNumber] line. | 16:53.20 |
Diemex | It is this line: clazz = (*env)->FindClass(env, "android.graphics.RectF"); | 17:00.02 |
Robin_Watts | Diemex: wow, I did not expect that. | 17:01.37 |
Diemex | Robin_Watts: I got it working. http://pastie.org/9663338 Not nice, I'm not proud of it, but it works. | 17:10.48 |
Robin_Watts | Cool. | 17:11.12 |
Diemex | Thanks for your help | 17:13.31 |
Robin_Watts | np. | 17:16.08 |
Diemex | Have you ever seen a pdf where the top left corner isn't [0,0] like [10,10, 596, 841] ? | 17:29.35 |
rayjj | henrys: sorry I wasn't paying attention here. I saw the discussion about PrinterName (bug 695617) and think I follow it -- you want to add a device "init' proc that is called by gx_device_init if the proc in the prototype (static) device is non-NULL ? | 17:49.38 |
| Diemex: Yes | 17:49.50 |
| Diemex: and often people want to "do what Adobe does" which is open using the CropBox (not the MediaBox) and that very commonly has LL not at 0,0 | 17:50.54 |
| Diemex: I even vaguely recall negative values for the lower left, but that my have been the %%%BoundingBox in PS/EPS | 17:51.41 |
| (that is supposed to be two % symbols) -- I think I got it wrong going through chatzilla's magic escapes | 17:52.32 |
| Diemex: I just scanned our PDF testfile collection and I see one file that has MediaBox: [-268 -199.685547 3102.39355 2184.25195] CropBox: [-268 -199.685547 3102.39355 2184.25195] :-o | 18:07.58 |
Diemex | rayjj: that is some huge pagesize | 18:08.40 |
rayjj | Diemex: yeah -- we get a lot of big page size files. that isn't the largest. | 18:11.18 |
| I think the largest we have in our collection is MediaBox: [0 0 10199 6496] | 18:13.55 |
| that was the test file for bug 692174 | 18:14.24 |
| Diemex: out of our set of 2303 PDF files, there are 21 with negative initial coordinates. One of the screwiest is MediaBox: [-1602 -1512 2214 2304] | 18:19.05 |
Robin_Watts | Who is trying and failing to log into android@ghostscript.com ? | 18:30.32 |
| Henry. | 18:31.42 |
henrys | rayjj: yea that's what we were talking about doing. We should have some initialization before the parameter procedures are called. Make sense? | 18:48.23 |
rayjj | henrys: I suspect that generally device specific initialization (if working from the static device struct wasn't good enough) is being done in the get_params call which devices can rely on (at least with PS) to be called before put_params or anything else | 18:57.56 |
| but an explicit 'init' proc seems cleaner | 18:58.13 |
| and other parsers that use the graphics lib won't have to make a get_params call early unless they need/want to | 18:59.05 |
| henrys: I saw the comment in the bug that this is specific to Windows. So that's because PrinterName is only a parameter pertinent to Windoze ? | 19:01.58 |
henrys | rayjj: yes | 19:05.56 |
| off to lunch... | 19:07.30 |
rayjj | henrys: OK. Thanks. I'm heading to lunch as well... | 19:07.41 |
| Forward 1 day (to 2014/10/21)>>> | |