IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2016/06/09)20160610 
squ DEBUG backtrace:07:30.48 
  DEBUG #00 pc 00037bbc /data/app/lib/arm/libmupdf_java.so (Java_com_artifex_mupdfdemo_MuPDFCore_getPageLinksInternal+199)07:30.48 
  DEBUG #01 pc 0071b541 /data/app/oat/arm/base.odex (offset 0x509000) (com.artifex.mupdfdemo.LinkInfo[] com.artifex.mupdfdemo.MuPDFCore.getPageLinksInternal(int)+84)07:30.48 
  DEBUG #02 pc 0071d1dd /data/app/oat/arm/base.odex (offset 0x509000) (com.artifex.mupdfdemo.LinkInfo[] com.artifex.mupdfdemo.MuPDFCore.getPageLinks(int)+72)07:30.48 
  DEBUG #03 pc 00975fe7 /data/app/oat/arm/base.odex (offset 0x509000) (com.artifex.mupdfdemo.LinkInfo[] com.artifex.mupdfdemo.MuPDFPageView.getLinkInfo()+74)07:30.48 
  DEBUG #04 pc 0097b279 /data/app/oat/arm/base.odex (offset 0x509000) (com.artifex.mupdfdemo.LinkInfo[] com.artifex.mupdfdemo.PageView$1.doInBackground(java.lang.Void[])+60)07:30.49 
  DEBUG #05 pc 0097b1f1 /data/app/oat/arm/base.odex (offset 0x509000) (java.lang.Object com.artifex.mupdfdemo.PageView$1.doInBackground(java.lang.Object[])+92)07:30.49 
  DEBUG #06 pc 0096248f /data/app/oat/arm/base.odex (offset 0x509000) (java.lang.Object com.artifex.mupdfdemo.AsyncTask$2.call()+258)07:30.50 
  DEBUG #07 pc 0230c053 /system/framework/arm/boot.oat (offset 0x1f61000)07:30.50 
kens squ kindly don't spam the channel07:31.00 
  If you want to show us extensive text, put it on pastebin or something, and put the link here07:31.32 
squ kindly make normal software07:31.48 
kens ha, about 2 seconds ahead of me kicking him07:32.20 
psmlbhor kens, I have been trying out image dictionary but I get /undefined error. I have pasted it at http://pastebin.com/ReygcDEK . Can you take a look?07:36.20 
kens I wouldn't bother setting interpolaet07:37.38 
  You haven't set the colour space to RGB07:38.03 
  So teh Decode array will be incorrect07:38.17 
psmlbhor OK. And also how can I represent the image data in binary format ? I didn't get it07:38.55 
kens You've flipped the imagematrix so that it goes down instead of up, but you haven't offset the origin, so it will draw off the bottom of the media07:38.58 
  Just put binary in the file07:39.10 
  after teh end of 'image' binary data.07:39.33 
psmlbhor I take the data to be converted in Hex as unsigned char* , how will I write it in binary then?07:41.17 
kens You have 2 gsave operators and only one grestore. Its not a big deal for simple files but you should make them balance07:41.22 
  Convert the hex into binary.07:41.34 
psmlbhor ok, and I assume I should remove the /ASCIIHexDecode filter also, right?07:42.25 
kens Well yes :-)07:42.32 
psmlbhor ok. Thanks07:42.45 
kens NP07:42.55 
ferter hi everyone! may i ask you, how do i create pdf files in mupdf? so i open source file and then i create a destination file with pdf_create_document and add pages with pdf_create_page. but how do i render source's text on it?09:37.52 
kens MuPDF isn't really intended, currently at least, as a means of creating PDF files09:38.37 
ferter oh09:38.49 
  so i basically can't do it with it and have to use something else?09:39.56 
  can't use MuPDF here*09:40.16 
kens I wouldn't like to say as I'm not a MuPDF developer. It *may* be possible, but I'd guess it won't be an ideal solution at the moment. This may well change of course, its more possible than it used to be09:40.52 
jogux kens: the guy being rude was I'm fairly certain the Indian guy who's being going at this for 2 weeks+ now, not willing to pay anything but wants us to help him fix bugs in his commercial e-magazine app.09:42.28 
kens Yeah I remember him form before, which was why I was going to kick him with no further warning09:42.57 
  And then he ran off before I could09:43.06 
jogux :)09:44.59 
  always a good idea to abuse the people trying to help you when you're using (likely) using their software without a valid license.09:48.38 
kens Indeed :)09:48.51 
psmlbhor kens, I read more about the ImageMatrix and offset of origin but I am not able to get the required image. The page is displayed but image isn't10:33.31 
kens Then most likely the Matrix is incorrect10:33.51 
  You've inverted the CTM so that it runs top to bottom, but not translated the origin10:34.15 
psmlbhor what should be the tralation ?10:34.35 
kens So it still starts at y=0 and goes *down* therefore going off the page. You need to alter Ty10:34.39 
  Ty should be something like -7100 or so10:35.01 
  I can't recall the numbers off the top of my head10:35.20 
psmlbhor so, [1 0 0 -1 0 -1] will do?10:35.21 
kens No10:35.27 
  more like [1 0 0 -1 0 -7100]10:35.39 
  You need to translate the origin back up the page so it starts at the top10:35.50 
psmlbhor 0 7100 translate ?10:36.14 
  and then the matrix u suggested ?10:36.26 
kens No10:36.47 
  If you translate first then Ty hsould be 010:36.58 
  The matrix I suggested was to do the whole operation in one step10:37.13 
Robin_Watts ferter: We are working on that at the moment.10:37.25 
psmlbhor so using your matrix won't require translation ?10:38.01 
kens The trasnlation is *in* the matrix10:38.12 
  But you will need to fiddle with the numbers to get it right10:38.26 
psmlbhor ok. I will try that out. Thanks10:38.42 
Robin_Watts ferter: You can use pdf_page_write.10:38.50 
  See mutool.c for calls to it to see how it works.10:39.18 
psmlbhor kens, it didn't work10:42.28 
kens psmlbhor : then something is wrong.10:45.30 
  SO you need to debug it10:45.36 
  This involves a systematic approach10:45.43 
  You should first try the simplest possible example10:45.53 
  The PostScript Language Reference Manual has examples you can type in, the turkey being the best know, or you can simply define a 2x2 square.10:46.22 
  Put that in the centre of the page.10:46.33 
  Then experiment iwth inverting it and see what you have to do to the CTM to get the image correct.10:46.51 
psmlbhor Is there any other reference you can point me to?10:47.38 
kens The PostScript Language Reference Manual is the bible for all things PostScript10:47.54 
  You could look at the green book and the blue book (tutorail and cookbook)10:48.12 
Robin_Watts psmlbhor: Google for matrix maths tutorials.10:48.21 
kens These are availabe somewhere on the web10:48.21 
  The PLRM does have a useful section on matrix manipulation, as used in PostScript10:48.44 
  TBH I always find with images that I need to start from first principles, because the image matrix is concatenated with the CTM at the time, and I almost always get it upside down on my first attempt10:50.50 
Robin_Watts psmlbhor: Once again, I feel compelled to point out that mupdf can do all this for you. I thought the whole point of this exercise was to leverage MuPDF rather than to reinvent the wheel.10:51.30 
psmlbhor with 5 parameter form of the image command, the image matrix was easy. But with this image dictionary, it's getting diffcult10:51.49 
Robin_Watts You might want to check with your mentor that you are actually doing the right thing here.10:51.51 
kens psmlbhor : The eventual matrix is exactly the same.10:52.16 
  And you can do it in separate stages, and then have the image matrix be the identity10:52.33 
psmlbhor Robin_Watts, The input file being raster is not supported by MuPDF, that's why I was continuing with the current thing.10:53.05 
kens MuPDF does indeed support image input10:53.18 
Robin_Watts psmlbhor: What is the input file ?10:53.19 
  TGA?10:53.32 
psmlbhor PWG raster file10:53.33 
  sorry?10:53.42 
kens TGA ? LOL....10:53.45 
Robin_Watts Right, so it's trivially easy to add PWG support for MuPDF.10:53.59 
  That would be a better use of your time, IMHO.10:54.16 
  kens: PWG, TGA, TMTLAs.10:54.54 
kens I'd have to agree, while learning PostScript is fun for those of a masochistic bent, its not hugely useful10:55.02 
psmlbhor Robin_Watts, actually, I have almost completed this raster to PS filter. Just making the PS file smaller in size was remaining. That's why I was continuing with it10:55.15 
kens So we need to extend to FLAs ?10:55.16 
Robin_Watts Just overload the TLAs we have. That'll make everything easier.10:55.48 
kens I thought we already were, eg CMAp, oh wait.....10:56.09 
  Umm looks like the matrix should be [5100 0 0 6600 0 6600] bewcause it has to map from the unit square to the desired coverage, flip the y axis, and offset the origin by the size of the image10:58.49 
  But that's just by inspection, and I did mention that I usually get that math wrong on the first attempt.....10:59.16 
Robin_Watts flipping the y axis I would expect [5100 0 0 -6600 0 6600]11:01.13 
kens D'oh yes that's what I meant, typo sorry11:01.34 
Robin_Watts (0,0) maps to (0,6600), (1,1) maps to (5100, 0) - seems plausible.11:01.51 
psmlbhor Robin_Watts, but I tried that and it didn't work11:03.34 
kens Thenyou're back to debugging, as I said, I'd start with a nice small image and work up11:04.09 
psmlbhor kens, I think I should do that.11:04.32 
kens Make a nice simple image, ideally non-square11:04.58 
  draw it in the centre of the page11:05.06 
  Then you can apply a matrix to invert the y direction and see what happens ot the image11:05.25 
  Work out what you have to do to move it back to the centre11:05.35 
  That should help you figure out what you have to do to the large image. The principle will be the same, its just the numbers that differ.11:06.00 
psmlbhor kens, I did that and successfully got the transformation matrix (which is equal to what Robin_Watts had suggested; I might have made a mistake earlier)11:19.31 
  I also converted the hex data to binary but the file size went from 500 MB to 2.2 Gb11:19.52 
Robin_Watts Urm.... You used binary rather than hex, and it got BIGGER?11:21.15 
psmlbhor yes11:28.31 
Robin_Watts Then you made a mistake.11:29.05 
  hex data takes 2 bytes for each 1 byte of binary.11:29.20 
psmlbhor i just converted the hex data to its equvalent binary11:30.11 
Robin_Watts "4041424344" is larger than "@ABCD"11:30.17 
  psmlbhor: You didn't translate it to "01010101010" did you?11:30.34 
psmlbhor i did11:30.42 
Robin_Watts Well, don't do that.11:31.01 
  What we are saying, is that instead of putting say "FF", send instead a byte with value 255.11:31.31 
psmlbhor how can I send that, paste 255 instead of FF?11:32.14 
Robin_Watts psmlbhor: ???11:32.47 
  This is a computer generated file, right?11:32.59 
psmlbhor yes, my filter generates it11:33.14 
Robin_Watts Right, and your filter is written in C?11:33.26 
  so presumably you're doing something like: fprintf(out, "%02x", val);11:33.53 
  instead, do: fprintf(out, "%c", val);11:34.05 
  (or the equivalent using fputc etc)11:34.15 
psmlbhor OK. I will try it now11:35.34 
ferter Robin_Watts: thank u. but how do i set page content? like text and staff11:55.08 
  once i've created one11:55.34 
Robin_Watts ferter: You can use pdf_page_write.11:56.43 
  That returns an fz_device.11:56.56 
  You then make all the fz_device calls you want to create the page content.11:57.09 
  This can be done manually by yourself, or you can call something like fz_run_page to send an existing page (perhaps in a different format) to it.11:57.49 
ferter Robin_Watts: oh. alright. thank you!11:59.47 
ts1690 Hi there, hope someone can help.. compiling mupdf in vs 2012, had some probs with isinf and isnan but fixed those, now i only have problems with INFINITY and NAN regarding jsbuiltin and other js files. I set up defines for those bu get an error relating to modulus divide by zero which am not sure how to fix.. What i want to know is can i disable JS within mupdf completely? That will solve my problem. I tried removing some of the13:54.13 
  seems that those js projects are still being references13:54.24 
  i could maybe go back a few versions but would prefer to use the latest13:55.11 
Robin_Watts ts1690: Disabling js will not solve the problem.13:56.22 
ts1690 ah, any suggestions then?13:56.46 
  if I define NAN i get: error C2124: divide or mod by zero13:57.06 
Robin_Watts The problem is, I believe, the version of the ndk you are using.13:57.08 
  oh, wait, sorry....13:57.23 
ts1690 also: 'signbit' undefined; assuming extern returning int13:57.26 
Robin_Watts This is VS2012, not Android.13:57.36 
ts1690 vs doesnt adhere to c99 standards :(13:57.38 
  yep vs201213:57.45 
Robin_Watts I know. I use VS2005 all the time.13:57.46 
ts1690 sucks13:57.51 
Robin_Watts I have VS2010 and VS2015 here, but not VS2012.13:58.01 
  Give me a sec to try those.13:58.15 
ts1690 ah, have u managed to compile the latest 1.9a mupdf?13:58.21 
  ok thanks13:58.25 
  think need somekind of workaround for the divide or mod by zero error on line 56 of jsbuiltin.c: js_pushnumber(J, NAN);13:59.30 
  others are isinf, isinfinite, isnan again which am sure can fix, signbit which will need to look at and also round, so it seems that the line 56 of jsbuiltin is the final issue14:00.46 
  i put these lines into fitz.h to fix the isnan and isinf issues: #ifndef isnan #define isnan(x) ((x) != (x)) #endif #ifndef isinf #define isinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF)) #endif14:01.20 
Robin_Watts OK, VS2010 builds it just fine.14:02.00 
  Let me try VS201514:02.07 
jogux ts1690: line 149ish of system.h is probably very relevant here btw.14:04.06 
  #if _MSC_VER < 1700 /* MSVC 2012 */14:04.13 
  #define isnan(x) _isnan(x)14:04.14 
  #define isinf(x) (!_finite(x))14:04.15 
  #endif14:04.15 
Robin_Watts ts1690: VS2015 works fine too.14:04.26 
  jogux: Ah, you beat me to it.14:04.36 
jogux :)14:04.42 
Robin_Watts I was going to suggest that that might need to be <= 170014:04.48 
  ts1690: If that solves it, let me know.14:05.00 
jogux ts1690: there's a similar chunk further up for signbit too.14:06.50 
ts1690 thanks for the fast response guys i will have a look14:09.14 
  yep i see the #if _MSC_VER < 1700 /* MSVC 2012 */ lines, so how come it cant find isnan and isinf?14:10.52 
  yep see the signbit too, still not quite sure what i need to do then ..14:11.40 
jogux ts1690: As Robin said, try a <= perhaps.14:11.45 
Robin_Watts Change < 1700 to <= 170014:11.52 
ts1690 aha, will try thank you!14:11.57 
jogux I suspect it should probably actually be < 1900 (1900 == VS 2015, which actually has something approaching C99 support)14:13.11 
Robin_Watts We'll move it as we get reports. We don't have every version to test.14:13.55 
jogux nods.14:14.03 
ts1690 ok so i get now 6 succeeded and 7 failed which i had before with my own isnan and isinf. i am getting same error in one.c : jsbuiltin.c(54): error C2124: divide or mod by zero14:16.35 
  jsbuiltin.c(89): warning C4013: 'isnan' undefined; assuming extern returning int14:16.47 
  jsbuiltin.c(95): warning C4013: 'isfinite' undefined; assuming extern returning int14:16.54 
  jscompile.c(164): warning C4013: 'signbit' undefined; assuming extern returning int14:17.03 
  and in wildcard.c:14:17.11 
  jsmath.c(75): warning C4013: 'round' undefined; assuming extern returning int14:17.20 
  jsnumber.c(40): warning C4013: 'isinf' undefined; assuming extern returning int14:17.29 
  maybe not in one.c and wildcard.c as u can see the files14:17.44 
  so is there an include of system.h needed for those errors somewhere?14:18.04 
Robin_Watts Same change to thirdparty/mujs/jsi.h14:18.13 
ts1690 yep that got it!!! thanks so much guys!!14:19.23 
  awesome!14:19.27 
Robin_Watts No worries. Thanks for testing the fix.14:19.36 
ts1690 best irc response ever, have a beautiful weekend guys!!!14:20.03 
  (and girls;)14:20.08 
Robin_Watts HenryStiles: So, should I start on this SOT TIFF thing ?15:07.56 
  Or should I wait for Miles to sort a contract out with the customer?15:08.34 
HenryStiles Robin_Watts: I would, but I wouldn't do the back and forth with the customer about which variety of tiffs before the contract stuff is done. There is a "core" that we know they'll want presumably15:09.43 
Robin_Watts HenryStiles: Well, we have 3 possible choices on how to go with this.15:10.15 
  1) LibTiff15:10.20 
  2) MuPDF's Tiff support15:10.27 
  3) bmpcmps tiff reader.15:10.32 
  3 is standalone.15:10.52 
  2 may require some infrastructure from MuPDF.15:11.11 
  1 is the heaviest option.15:11.17 
  1 has most coverage, 2 next, 3 next.15:11.24 
  So, depending on what level of support they want, it affects which route I go.15:11.47 
HenryStiles oh crapola I though mupdf was using libtiff like ghostscript15:11.52 
Robin_Watts No, it's standalone support.15:12.55 
  it's 953 lines, so not huge, but it does rely on fz_streams etc.15:13.48 
HenryStiles then it does seem we should have the conversation with the customer first unless you choose 1. I assume you and tor are opposed to bringing libtiff into mupdf and just having everyone use that? That is a bit separate from the immediate task but it would be nice to have one tiff solution for all our products.15:16.30 
  with the complete coverage15:16.47 
jogux Even with 1 there's a choice of how many of libtiff's dependencies we bring in, but at least that's something we can do piecemeal. I think I'd favour libtiff.15:18.04 
  (we did ask the customer btw, who said they didn't know, but /their/ customers had asked for tiff support.)15:18.34 
psmlbhor Robin_Watts, i did what you suggested, but I got ioerror in -image-16:44.01 
Robin_Watts psmlbhor: I'm afraid my crystal ball is on loan at the moment, so I won't be able to comment without seeing an example file.16:44.51 
psmlbhor i can paste it on paste bin, but not the whole file as it is more than 100MB in size16:45.43 
Robin_Watts psmlbhor: Well, can you make a smaller example?16:46.02 
psmlbhor ok16:46.08 
  how about pasting the command and one or two lines of binary data ?16:46.53 
Robin_Watts I'd rather download the complete file from somewhere.16:51.24 
  because the ioerror might be related to the length of the file or something.16:51.40 
  but I don't want a 100Meg file.16:51.46 
psmlbhor Robin_Watts, I manged to make a file of 13 MB. Here https://drive.google.com/open?id=0B-wSviYjd5oCVDEtNHZoTzR5RWc18:03.14 
  but the error is undefined in the case of this file18:04.09 
Robin_Watts You mean you get "/undefined" as an error ?18:04.33 
psmlbhor Error: /undefined in 0\00\00\00\0018:05.29 
Robin_Watts psmlbhor: You are not output the data correctly.18:18.43 
  Putting \00 in a file is not the same as putting a 0 byte.18:18.58 
  Also, you appear to be sending a \n every 39 bytes.18:19.40 
psmlbhor %c for 0 must have printed \0018:19.56 
Robin_Watts pastebin your code.18:20.15 
psmlbhor only the hex to bin conversion or full source code file?18:20.47 
Robin_Watts fputc(value, file);18:20.50 
  Just the code that outputs the data.18:21.14 
psmlbhor ok. Just a minute18:21.35 
  http://pastebin.com/G3qGjxG418:23.04 
Robin_Watts seriously!18:23.55 
  I mean, seriously, you are reading a byte, converting it to hex, then converting it back from hex to print it?18:24.22 
  fputc(*data, stdout);18:24.47 
psmlbhor well, Kens suggested that earlier18:24.57 
Robin_Watts and lose everything to do with if (col >= 78).18:25.11 
  No, he really didn't.18:25.22 
  Just write the data as raw bytes. No hex conversion is required.18:25.46 
psmlbhor Robin_Watts, I did. But still got \00 in the PS file. When I run it using ghostscript, no error is given but output is not displayed18:31.32 
Robin_Watts There is a difference between having \00 in the PS file, and your editor showing it as \00.18:32.53 
  How big is the latest file?18:33.43 
  with luck it should be about 1/3 of the size.18:33.54 
psmlbhor it is far less that what it used to be18:34.23 
  earlier 103 MB, now 7.1 KB18:34.35 
Robin_Watts Put it up for download.18:35.05 
  The image before was 4958*7017, in 1bpp.18:35.53 
  so you'd expect that to be 4958*7017/8 ish bytes = 4 to 5 Meg or so.18:36.33 
psmlbhor https://drive.google.com/open?id=0B-wSviYjd5oCRW5lalZKWUwwOWM18:36.43 
Robin_Watts You do at least now have proper binary 0 bytes in the file.18:38.03 
  pastebin your new output code.18:39.18 
psmlbhor but the output is not correct18:39.57 
Robin_Watts You've made a file which prints an entirely white image.18:41.09 
  In order to see what you've done wrong, I need to look at your code.18:41.39 
  So, please, pastebin your new output code.18:41.50 
psmlbhor you mean C code that generated the PS file?18:43.28 
Robin_Watts Obviously, yes.18:43.41 
psmlbhor ok18:43.50 
  http://pastebin.com/z158NFiA18:48.59 
Robin_Watts WHAT!18:49.31 
psmlbhor what happened?18:51.11 
Robin_Watts The %s format specifier to printf says "print the null terminated string pointed to by the respective argument.18:51.12 
  fwrite(pixdata, 1, header.cupsBytesPerLine, stdout);18:52.32 
  That is what you want to call instead of your printf.18:52.44 
psmlbhor Robin_Watts, it worked for that file. But gave /limitcheck error in other test file19:03.00 
Robin_Watts psmlbhor: OK. That sounds like a different matter, and one I am not qualified to comment on.19:06.12 
psmlbhor Robin_Watts, Thank you all your help19:06.37 
  Even I am feeling terrible to keep bothering you and Kens for every single thing19:07.04 
 Forward 1 day (to 2016/06/11)>>> 
ghostscript.com
Search: