IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2012/12/20)2012/12/21 
Robin_Watts As you say your job is to help teams abide by licenses etc, you probably understand the GNU GPL just fine, but in case you don't...00:00.22 
  I am not a lawyer, so you should consult the exact wording of the license, but in broad strokes, if you want to use MuPDF within your organisation, you have no problem doing that, as long as you don't start distributing it to other people.00:02.13 
  The moment you start distributing it, or bundling/integrating it with other apps there are all sorts of restrictions that kick in.00:02.50 
sutula Robin_Watts: Thanks, yes. The main thing I was hoping for was a statement of how Artifex interprets aggregation/derived works, and sebras helped find it above. It's helpful to be able to point other people to these kinds of statements.00:04.10 
Robin_Watts sutula: Our website was updated less than 24 hours ago, hence the google oddness.00:04.39 
sutula OK, thanks. That'll get solved in time then.00:05.07 
sutula needs to be afk for a while00:05.50 
JakeSays ray_work: i need both, but gs only on the server07:35.50 
  ray_work: and thats good to know about the flattening control. i'll investigate07:36.22 
bencc I have a pdf with text displayed with images not the actual fonts08:57.33 
  can I increase the screen resolution so it'll look better in a pdf viewer?08:57.49 
kens bencc what exactly are you asking about ?08:58.17 
  If the font is already rasterised, then you can't change the resolution08:58.35 
bencc kens: if gs can increase the image quality08:58.39 
  maybe thicken the lines08:58.49 
kens bencc no not really. Especially not if you want to get a PDF as the output08:59.07 
  If you are rendering to a bitmap you could use -dGraphicsAlphaBits or -DDOINTERPOLATE08:59.41 
  But the PDF writing code goes to considerable lengths *not* to change the input09:00.00 
bencc isn't there a way to duplicate each pixel?09:00.02 
kens bencc no09:00.18 
bencc ok09:00.47 
kens Depending how the PDF is constructed you could possibly modify it to turn on interpolation for the images which represent text, which might make things better, but you would have to make the change in the PDF manually09:01.46 
  And it would still depend on the PDF viewer honouring the interpolation flag09:02.05 
bencc how can I make the changes manually?09:02.48 
kens It depends on how the file is constructed, as I sai.09:03.02 
  You owuld need to locat the relevant images in the file and add the /I flag09:03.15 
  WHich would probably change the offsets of all the object, so you would eiother need to rebuild the xref table, or have a tool repair the file for you09:03.51 
bencc how can I find the image in the file?09:03.53 
  just add /I ?09:03.59 
kens bencc do you understand PDF syntax ?09:04.11 
bencc no :)09:04.15 
kens THen I'm afraid this is a task you can't do09:04.25 
bencc probably not09:04.37 
  I wish I was smarter09:04.41 
kens Its not smarts, its just a case of learning the syntax09:04.55 
bencc I see obj... endobj stuff in the pdf09:05.00 
  I think it only has several pages, each as a huge image09:05.13 
kens All objects in a PDF file are marked that wasy09:05.14 
bencc 46 0 obj<</Length 2575/Filter/FlateDecode/N 3/Alternate/DeviceRGB>>stream09:05.35 
  can I add the /I tag there?09:05.44 
kens bencc if each page is a dingle image, then you could possibly modify the image flag, but that will modify the whoel image, not the text09:05.45 
bencc that's fine09:05.56 
  can I do that?09:05.58 
kens bencc that is an ICBasecd colour space, not an image09:06.01 
  FInd the /Pages entry09:06.23 
bencc 47 0 obj<</Subtype/Image/Length 2302/Filter/CCITTFaxDecode/ImageMask true/BitsPerComponent 1/Width 1720/DecodeParms<</K -1/Columns 1720>>/Height 510/Type/XObject>>stream09:06.23 
kens OK that's an image09:06.33 
bencc how can I add the /I tag?09:06.59 
kens Just a minute, I'm reading the spec to make sure I give you this correctly09:07.18 
  OK between the << and >> insert /Interpolate true09:08.24 
  Use a binary editor09:08.29 
  THis *will* break the file because the offsets will all be wrong09:08.40 
  So you will need to repair it09:08.47 
bencc ok09:08.53 
kens You cany try readin it 'as is' with GS whcih might work, otherwise I woudl reccomend MuPDF and the mupdfclean tool09:09.17 
  If it works reading it with GS you should be able to use the pdfwrite device to rewrite the file as a valid file09:09.52 
bencc do I insert /Interpolate true after Image/ ?09:16.20 
kens Anywhere between teh << and >> as long as you don't interrupt the other pairs. Best to put it right before the >> I would say09:17.09 
bencc when trying to edit with nano (ubuntu), I just delete one char and add it back and save09:19.00 
  and than can't use this pdf09:19.07 
  so nano somehow corrupt the pdf09:19.15 
kens I owuld suggets that it is changing the line endings09:19.19 
  CR/LF to LF or similar09:19.27 
  WHich is why I said to use a binary editor09:19.35 
  If it does that to image data it will not work09:19.53 
  THe image data is in a compressed data stream, if you corrupt the compressed stream it will be invalid and won't decompress09:21.12 
bencc I think I'll give up. thanks 09:22.16 
kens NP09:22.20 
Robin_Watts End of world failed to appear.11:29.36 
kens 8pm tonight11:29.42 
Robin_Watts Guess I'd better do some work :(11:29.43 
  tor8: ping!11:29.49 
  11:11, according to the radio.11:29.58 
tor8 Robin_Watts: damn. no apocalypse this time either?11:31.22 
Robin_Watts nah. Wish I'd paid that credit card bill instead of spending it all on booze and hookers.11:31.42 
  Dear Mr Osbourne, I know I have a tax bill due by the end of January, but...11:32.19 
  tor8: various reviews up.11:33.05 
  My bmpcmp is vaguely interesting.11:33.25 
  That's the results from the tiling change.11:33.36 
  all invisible to my eye.11:33.46 
tor8 Robin_Watts: ever see that silly movie 2012?11:38.11 
Robin_Watts I did. A Disaster movie in every sense.11:39.04 
tor8 indeed.11:40.14 
  everything before the tiling patch is good to go. studying the tiling patch now.11:40.32 
  Robin_Watts: umm, why don't we intersect the 'area' with the scissor instead (for quickly dropping out of view tiles)12:07.39 
sebras tor8: one trivial patch over at sebras/master12:09.12 
  tor8: and the openjpeg 1.5.1 update that has a regression (bug 205 at openjpeg.org)12:09.27 
tor8 sebras: okay, but I think we want to upgrade to openjpeg 2 as well. do you know if the APIs have changed?12:10.17 
sebras tor8: no I haven't looked in to that.12:12.18 
  tor8: maybe we should take the upgrade to 1.5.1 as a stepping stone for the next release and openjpeg 2 later?12:12.44 
tor8 sebras: where did you put the thirdparty/openjpeg.git you used to upgrade?12:20.15 
  nvm, found it12:20.50 
  sebras: umm, odd merge graph there...12:21.54 
  nvm, again, that's the second time this week git logg has me confused :(12:23.31 
  sebras: okay, thirdparty/openjpeg.git updated12:27.13 
sebras tor8: but I did it correctly, no..?12:28.44 
tor8 sebras: actually, no, you did make one mistake...12:29.01 
  autom4te.cache got checked in12:29.07 
sebras tor8: oh. crap.12:29.23 
  tor8: and re: the bug in openjpeg: http://code.google.com/p/openjpeg/issues/detail?id=20512:29.36 
  I found one file affected in my own insane suite.12:29.55 
  the pixmap is rendered, but it is mostly white I think (or possibly transparen)12:30.30 
tor8 sebras: I backed out the push to thirdparty/openjpeg.git in case you want to redo the checkin12:30.34 
sebras tor8: ok. do you mind if I do it tonight after work?12:32.10 
tor8 sebras: no rush12:34.28 
mvrhel_laptop good morning13:38.50 
kens Morning Michael13:38.59 
mvrhel_laptop kens: sounds like you have things figured out now13:39.22 
kens I hope so13:39.29 
  Have to rework the code though13:39.36 
Robin_Watts tor8: That would make a lot of sense (intersecting scissor with area)13:43.04 
  having decided that the world has not ended, the masses have descended upon sainsburys.13:43.46 
  I just popped in to get a couple of things.... nightmare.13:43.56 
mvrhel_laptop seriously?13:44.55 
  oh I read that wrong13:45.07 
  We toured Colonial Williamsburg yesterday with the kids learning about British Oppression.13:47.17 
  The English Governor's mansion was pretty fancy 13:47.37 
Robin_Watts mvrhel_laptop: We no longer have British Oppression. We just have British Repression. :)13:51.34 
kens Help, help I'm being oppressed13:51.54 
Robin_Watts See the violence inherent in the system!13:52.07 
mvrhel_laptop :)13:53.19 
Robin_Watts tor8: If we intersect the areas before we calculate the x0/x1/y0/y1 for the tile repeats then we don't need to do the subdivision etc.14:05.03 
  Or the 'is this meta-tile completely obscured' check.14:05.27 
  I'll remove all that too then.14:05.38 
  tor8: ping.14:53.58 
  I think 'area' is pre-ctm, and scissor is post-ctm.14:54.16 
  hence we can't intersect scissor with area unless we invert the ctm.14:54.34 
  What do you think is preferable? The matrix inversion or the subdivision?14:55.04 
tor8 matrix inversion :)15:03.50 
  Robin_Watts: http://www.billioncountdown.com/15:03.58 
  the apocalypse is near...15:04.06 
Robin_Watts tor8: haha!15:04.38 
  tor8: That link seems to have transformed to be a link to a porn site now.15:31.58 
tor8 Robin_Watts: indeed it has :/15:42.11 
  I guess it reached a billion views!15:42.18 
Robin_Watts New version of the tiling patch online now. tests running.15:44.37 
tor8 Robin_Watts: well that was a smaller patch :)16:03.16 
Robin_Watts just a bit :)16:05.38 
  but the inverse process misses stuff :(16:06.23 
  I need to add in a fudge factor I think.16:06.31 
  tor8: At last, got it to pass.16:45.05 
  New patch up.16:49.29 
tor8 Robin_Watts: scary bit stuff: ~a.x0^-expand)&(a.x0^b.x0)16:52.08 
Robin_Watts tor8: Yeah.16:52.16 
  Would you prefer me to rework that into a macro with a comment explaining it?16:52.34 
  cos it's used at various places now.16:52.46 
tor8 yeah, I think that'd be a good idea16:53.54 
Robin_Watts Can I do that as a followup?16:54.02 
tor8 yeah. that'll be clearer if you change the other instances too.16:55.05 
Robin_Watts New review for you then.17:10.37 
baudehlo Hi - I'm using gs to convert PDFs to PNG. I've got it working great, and almost all PDFs look fine, except for one where one of the logos comes out extremely ugly/blocky looking. I've tried every param I can find info on but nothing helps. The PDF looks fine… Any tips?17:12.43 
  relevant params are: -dDOINTERPOLATE -dDITHERPPI=20 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -r100 17:14.36 
Robin_Watts does it look OK in (say) Acrobat?17:23.53 
baudehlo Yeah17:30.28 
  Want me to put an example somewhere?17:30.49 
Robin_Watts sure.17:32.39 
baudehlo OK here's the PDF and the rendered version in my google drive: https://docs.google.com/open?id=0B0x1UWn27ExjLVJtdmN4UklTa0E17:33.00 
  https://docs.google.com/open?id=0B0x1UWn27ExjNjdTM3F3U2h4LTg17:33.00 
  (ignore how google drive fucks up the rendering)17:33.21 
Robin_Watts And which logo is bad?17:34.59 
baudehlo The top right main rogers logo17:35.17 
Robin_Watts I bet that's an imagemask.17:35.26 
baudehlo Other PDFs with logos in use the GraphicsAlphaBits and anti-alias the logos.17:35.37 
Robin_Watts well, that's interesting. mupdf doesn't render it at all.17:36.44 
baudehlo what's mupdf?17:36.54 
Robin_Watts baudehlo: It's quite possible that that logo is done as a mask with solid fill - so interpolation doesn't apply.17:37.16 
  mupdf is our other PDF renderer.17:37.24 
baudehlo Ah. Yeah xpdf struggles with it too.17:38.09 
  (xpdf output looks like what's on the google drive default view)17:38.26 
Robin_Watts D'Oh.17:38.37 
  It's a 6 page document. rendering page 1 with mupdf looks fine.17:38.46 
JakeSays baudehlo: out of curiosity, how does chrome render it?17:38.49 
baudehlo JakeSays: yep17:38.58 
  looks gorgeous in chrome on the mac17:39.06 
Robin_Watts baudehlo: If your intent is just to take PDFs to PNGs you may want to consider using mupdf instead of gs. It's more screen-centric.17:39.39 
JakeSays ah hmm. that didnt really answer my question. chrome/mac doesnt use the same pdf renderer as chrome/non-mac17:39.46 
baudehlo JakeSays: oh. Lemme try on 'doze17:40.02 
  Robin_Watts: first I'd heard of mupdf so I'll give it a shot - how do you do pdf2png with it?17:40.26 
Robin_Watts mudraw -o out.png -r resolution in.pdf17:40.41 
  Or for multiple pages:17:40.53 
  mudraw -o out%d.png -r resolution in.pdf17:41.01 
baudehlo Robin_Watts: can I do stdin/out and one page at a time?17:41.41 
  JakeSays: yep, renders beautifully on Chrome/Win717:41.54 
Robin_Watts baudehlo: 1 page at a time, yes, stdin/stdout, not with the current code.17:42.33 
baudehlo bah :)17:43.07 
  well I guess gs has to write stdin to a temp file anyway17:43.22 
  so I can just do that outside of the call17:43.30 
  but not being about to do stdout is annoying17:43.46 
sebras Robin_Watts: um. the logo renders fine in mupdf here...? what parts are missing when you try?17:48.44 
Robin_Watts sebras: It renders fine for me too. I was foolishly rendering page 6 :)17:49.08 
sebras Robin_Watts: ah. however I see that Google Drive's pdf-renderer fails to render some strings on page 2 that mupdf renders fine.17:50.06 
Robin_Watts there are fonts missing.17:50.38 
sebras they are inded.17:50.59 
  interesting, so everything for the fonts is there but the stream data. :)17:51.35 
  that's an odd one...17:51.40 
Robin_Watts That's just non-embedded isn't it?17:52.01 
baudehlo where do I get jbig2.h from on a mac?17:52.18 
Robin_Watts For building mupdf?17:52.32 
baudehlo yeah17:52.36 
Robin_Watts Are you building from git or from the release?17:52.41 
baudehlo release17:52.47 
  can build from git if better though17:52.54 
Robin_Watts Then download the "thirdparty" archive and unpack that.17:53.04 
  git is newer, certainly.17:53.14 
baudehlo ok17:53.44 
  so after extracting "thirdparty" do I just go into each and make install them?17:54.26 
Robin_Watts no, just make mupdf again.17:54.45 
  and it will spot the thirdparty dir and make the contents.17:55.00 
sebras baudehlo: the thirdparty directory should reside in your mupdf source directory. (next to apps, fitz, fonts, etc...)17:55.28 
baudehlo gotcha17:55.33 
Robin_Watts (You extracted the thirdparty dir ... as sebras said, sorry)17:55.39 
baudehlo OK so the docs don't say much… what are the params for the first page?17:57.22 
Robin_Watts mupdf -o out.png -r resolution in.pdf pagenum17:57.50 
  mupdf -o test.png -r200 RogersBill.pdf 117:58.17 
sebras ./build/debug/mudraw -o page1.png -r 200 RogersBill.pdf 117:58.54 
baudehlo Oh wow way nicer.17:59.19 
  Except for the missing red line17:59.25 
sebras baudehlo: on page 1?18:00.24 
  just beneath the logo at the top of the page?18:00.40 
  I can see that line here...18:00.45 
baudehlo Hmm18:01.17 
  I did -r 8518:01.21 
  which is our default view size18:01.26 
Robin_Watts baudehlo: I can see the red line too with -r85.18:01.59 
sebras I see it with -r 85 too. but I'm compiling from git of course.18:02.03 
baudehlo ok, time to use git18:02.24 
Robin_Watts I'm compiling from (just ahead of :) ) git.18:02.30 
baudehlo as it screws up Fido bills with 1.118:02.36 
Robin_Watts With git, you need to clone, then: git submodule update --init rather than unpacking the thirdparty stuff.18:03.18 
baudehlo ok18:03.50 
  thanks.18:03.52 
  This is also like 10 or more times faster than GS18:04.30 
  so what's the downside of switching from gs to mudraw?18:11.25 
  is there any?18:11.30 
  like is it considered not production ready or anything?18:11.39 
Robin_Watts It's released software.18:12.45 
baudehlo what's being worked on right now in git?18:13.55 
  the current git output is way better than 1.1 fwiw18:14.12 
mvrhel_laptop bbiaw18:15.27 
Robin_Watts baudehlo: Lots of stuff. Interaction (forms, javascript etc), and bug fixing.18:36.07 
baudehlo and stdin/out? ;-)18:36.56 
Robin_Watts baudehlo: Nope.18:37.46 
  Doing pdf with stdin is silly, frankly, as it's inherently a format that you want to be able to seek within.18:38.14 
  so everything ends up buffering the whole contents either in memory or on disc somewhere.18:38.33 
baudehlo Yeah I know, but you could just do the tmp file internally18:38.48 
  but stdout would be nice18:38.55 
Robin_Watts "-o -" means stdout, actually.18:42.11 
sebras Robin_Watts: it does? did you try that?18:45.28 
Robin_Watts I checked the code, why?18:45.38 
sebras Robin_Watts: but in apps/mudraw.c::drawpage() we strstr() on pgm ppm pnm png pbm etc in the argument to -o and if neither of them apply we do nothing...18:46.21 
  am I missing something?18:46.45 
Robin_Watts oh. sorry. -o - is only for the -j option.18:46.59 
sebras we could add a default case and assume png in that case if we want to though...18:47.17 
Robin_Watts sebras: I've already lost interest :)18:47.41 
sebras Robin_Watts: yes, but there is patch at sebras/master waiting for you.18:51.48 
Robin_Watts ok. will look in a bit. (just in the middle of debugging a memory leak)18:52.28 
sebras baudehlo: http://goo.gl/CwVlU ./build/debug/mudraw -o /dev/stdout -r 85 RogersBill.pdf 1 2> /dev/null | file -18:53.00 
baudehlo sadly /dev/stdout won't work on Mac (our dev platform)18:53.37 
  it's fine - I'm using temp files18:53.42 
  and it's working fucking beautifully - you guys rock.18:53.55 
Robin_Watts fab. As a matter of interest, how are you using it?18:54.46 
  Currently MuPDF is released under the GNU GPL. We are probably going to change to use the GNU Affero GPL in the next release.18:55.46 
  If either of those are a problem for you, Artifex can license it commercially.18:56.45 
baudehlo Was just discussing that actually19:07.37 
  it's on a web site - real time conversion of PDFs to PNG19:07.51 
  so we may have to do the commercial license thing19:07.59 
Robin_Watts baudehlo: I am not a lawyer, so you'll have to judge that for yourself, but it sounds plausible to me.19:09.46 
baudehlo *nod*19:11.28 
  I'm an open source developer myself too, so I know most of the ins and outs19:11.48 
  even once contributed to gs years ago19:12.15 
JakeSays Robin_Watts: why is artifex switching to agpl?20:08.56 
  and is it mupdf and gs, or just mupdf?20:09.05 
Robin_Watts JakeSays: both, probably.21:04.20 
JakeSays Robin_Watts: it hasnt been that long since gs moved off of agpl21:49.50 
Robin_Watts JakeSays: gs used to be under the alladin public license.22:43.11 
  It has never been under the GNU Afferro GPL22:43.22 
  but the proposal is that it should become so.22:43.59 
bencc acrobat writer has a feature called "optimize scanned pdf"23:36.45 
  the scanned pdf had low quality text but after using this tool, it is much better23:37.16 
  can I do the same with gs?23:37.19 
 Forward 1 day (to 2012/12/22)>>> 
ghostscript.com
Search: