| <<<Back 1 day (to 2016/02/03) | 20160204 |
mvrhel_laptop | tor8: ok good to know about drop being for both free and rc'd objects | 00:22.51 |
| looks like ..\..\thirdparty\harfbuzz\src needs to be included for the x64 libmupdf settings | 00:26.40 |
Robin_Watts | mvrhel: oops, possibly. | 00:40.54 |
brettk80 | Hey all.. looking for a little help on Gs with some PDF2tiff conversions for group4 tiff that I cant seem to match up to my legacy converter. | 07:42.19 |
| Im not sure what is impacting it but the only thing different are my channel statistics in the tiff. | 07:42.48 |
kens | brettk80 : rendering a PDF to TIFF isn't exactly a conversion. But you're going to have to be more specific (probably with example files) about your problem. | 08:01.54 |
simon91 | Robin_Watts: morning. | 08:58.33 |
| Thanks for pushing the strtof. | 08:58.33 |
| The report also contained a separate two-line fix for fitz/ftoa.c: | 08:58.33 |
| http://bugs.ghostscript.com/attachment.cgi?id=12268&action=diff | 08:58.33 |
Robin_Watts | simon91: Will look at that later, ta. | 10:00.18 |
hyper_ch | hi there, I wonder how I can achieve that: I have a pdf with text layers and stuff. Now I want to remove that. I thought converting it to .gs and then back to .pdf would work. But that seems not to be the case | 10:23.58 |
kens | THere is no such thing as .gs | 10:24.16 |
| Also I'mnot at all sure what you mean by 'layers' PDF doesn't really have that copncept, at least not for text. | 10:24.42 |
| Perhaps if you shared an example file and explained what you want to chieve (and possibly why) we might understand better, and be able to help | 10:25.10 |
hyper_ch | kens, I'll send you in query | 10:59.15 |
kens | Your file appears to be a scanned page, (so an image) with text in text rendering mode 3 (neither stroked nor filled, so invisible) drawn on top of it. | 11:00.58 |
hyper_ch | so how can I remove that text? | 11:01.30 |
kens | Why would you want to ? | 11:01.40 |
| There is no siple way to remove the (invisible) text using Ghostscript | 11:02.14 |
hyper_ch | because I need to ocr again | 11:02.15 |
| if you copy the text, there's white space between each character | 11:02.32 |
kens | Well you could extract the image, surely that's better than having it as a PDF ? | 11:02.37 |
hyper_ch | how to extract teh images? | 11:03.44 |
| it's a 500pp pdf | 11:03.51 |
kens | Use MuPDF, not Ghostscript | 11:04.02 |
hyper_ch | what's mupdf? | 11:04.17 |
kens | Its another product from Artifex, it is better suited for this task | 11:04.30 |
| http://www.mupdf.com | 11:04.49 |
hyper_ch | already installing it in nixos | 11:06.07 |
| got it installed | 11:08.36 |
| I hate it when people don't come to the point in phone calls... 40min call what could have been a 3minute call | 11:10.58 |
| kens: from what I read, mupdf is a pdf viewer | 11:11.24 |
kens | mutool | 11:12.51 |
| I am not a MuPDF developer, so maybe Robin_Watts can guide you more | 11:14.11 |
hyper_ch | ah :) | 11:14.29 |
| kens: ha, mutools draw -o page%d.png file.pdf helps | 11:22.32 |
kens | OK | 11:22.43 |
hyper_ch | next, how to combine the pngs to pdfs ;) | 11:24.09 |
| convert helps here :) | 11:25.26 |
| good, now I can ocr again... it's like 200 pages that I need to extract the text ot have it translated | 11:25.45 |
| convert quality is bad :( | 11:26.11 |
tor8 | Robin_Watts: so, tried out the latest android studio, sdk, ndks... | 11:36.36 |
| they *still* haven't got their 64-bit story together. | 11:36.49 |
| android studio install fails with "Unable to run mksdcard SDK tool." | 11:37.06 |
| guess what? their mksdcard is a f-cking 32-bit binary. in the 64-bit version of their download. | 11:37.52 |
| and they don't show an appropriate error message unless you've already got multi-arch installed | 11:41.38 |
hyper_ch | kens: hmmm, not good... image quality with draw is also bad | 11:41.48 |
kens | THen the original image is probably of poor qulaiyt | 11:46.03 |
| I suspect you want -extract or something rather than draw | 11:46.17 |
tor8 | hyper_ch: if the document is just a bunch of scanned pages, you could try 'mutool extract' to extract the individual images. that'll get you the images without any scaling and filtering to render them to a page at a given size. | 11:54.17 |
hyper_ch | extract lead to the same result as draw | 11:54.22 |
tor8 | hyper_ch: then your source data is just bad quality | 11:55.49 |
hyper_ch | was scanned in at 200dpi | 11:56.05 |
| sorry, 300dpi | 11:56.30 |
tor8 | mutool extract extracts the actual images in the file, completely unmodified. | 11:56.32 |
hyper_ch | hmmm..... :( | 11:56.49 |
| but why does it look then much better in all pdf viewers? | 11:56.59 |
tor8 | it could be your image viewer | 11:57.57 |
hyper_ch | all of them? | 11:58.08 |
tor8 | I can't help anymore without seeing an actual example | 11:59.00 |
| hyper_ch: how did you run extract? the actual command line. | 12:00.00 |
hyper_ch | mutool extract Combined\ -\ extracted.pdf | 12:01.06 |
tor8 | and the extracted img-NNNN.png or jpg files look worse than the same pdf viewed in another pdf viewer? | 12:01.49 |
hyper_ch | yes | 12:02.08 |
tor8 | I find that surprising. | 12:02.21 |
| the extracted images are the raw 300 dpi scanned images | 12:03.33 |
| or at least should be, if that's what is indeed embedded in the pdf | 12:03.50 |
hyper_ch | or the scanner did something to them | 12:04.06 |
tor8 | well, if you're saying the "Combined - extracted.pdf" looks good in some viewers, but the images you extracted from them looks worse ... I have no idea | 12:05.49 |
hyper_ch | yes | 12:06.01 |
tor8 | define "worse" (or better yet, post a screenshot showing the difference) | 12:06.37 |
hyper_ch | I can give you the pdf of one page | 12:07.06 |
tor8 | okay. | 12:07.47 |
hyper_ch | actually, it seems I was wrong | 12:08.24 |
Robin_Watts | tor8: I can look at getting the android side working again. | 13:11.40 |
| No sense in both of us having pain. | 13:11.47 |
| Ok, I need some reviews done on the gs stuff, but I'm otherwise done. | 13:22.43 |
| So back to mupdf. | 13:22.52 |
| tor8: What's the state of play? Should I take your latest tor/jni stuff and work the android stuff back into it ? | 13:23.26 |
tor8 | Robin_Watts: just got back from lunch. I was at the state where I am trying to figure out how to run this thing in an emulator. | 13:51.29 |
Robin_Watts | tor8: I might look at moving all the non android stuff into platform/java, and making it build a mupdf.jar there. | 13:52.02 |
tor8 | Robin_Watts: that would be nice to have. | 13:52.15 |
Robin_Watts | Then have the viewer link that jar, and the android build include that jar too. | 13:52.19 |
tor8 | Robin_Watts: the platform independent DrawDevice stuff draws to a Pixmap | 13:52.36 |
| the pixmap data can be accessed either via a byte[] or an int[] ... the int[] only makes sense for BGR colorspace though | 13:52.55 |
Robin_Watts | Right. | 13:53.15 |
tor8 | I was thinking the AndroidDrawDevice would take an android.Bitmap and be completely separate from the platform independent DrawDevice | 13:53.18 |
Robin_Watts | Yes. | 13:53.27 |
| Pixmap is an Awt thing, right? | 13:54.02 |
tor8 | no, this is just a wrapper for fz_pixmap | 13:54.11 |
Robin_Watts | ah, perfect. | 13:54.18 |
| So the conversion from int[] or byte[] to something that the runtime java environment can blit happens outside of mupdf.jar then ? | 13:54.55 |
tor8 | awt_image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); awt_image.setRGB(pixmap.getPixels()); | 13:55.21 |
| yeah. see platform/java/PageCanvas.java for an example | 13:55.45 |
| I take the fz_pixmap wrapped Pixmap class, and ask for an int[] that I feed to BufferedImage | 13:55.59 |
| so there is no use of AWT classes in any of the stuff in com.artifex.mupdf.fitz | 13:56.54 |
| and the JNI code is blissfully ignorant of that too | 13:57.06 |
Robin_Watts | Perfect. | 13:57.18 |
tor8 | it might be worth looking at how the new JavaFX gui stuff works. | 13:57.20 |
| Robin_Watts: noob question. I set up av AVD and when I try to run "ant install" it errors out with: | 13:58.24 |
| [exec] Failure [INSTALL_FAILED_INVALID_APK] | 13:58.26 |
| [exec] rm failed for -f, Read-only file system | 13:58.26 |
Robin_Watts | tor8: Have you installed a virtual SD card for that AVD? | 13:58.53 |
| I suspect that emulators like you to do that, and then installing stuff goes onto that SD card, maybe. | 13:59.33 |
| I find it MUCH easier to use a real device. | 14:00.09 |
tor8 | yeah, I guess I should just plug in a real device | 14:00.29 |
| W/PackageManager( 59): Native ABI mismatch from package file | 14:00.39 |
| from logcat | 14:00.39 |
Robin_Watts | tor8: What device? | 14:02.29 |
tor8 | an armeabi AVD | 14:02.55 |
| now I just gotta wait 30minutes for my nexus tablet to charge enough to boot... *sigh* | 14:03.17 |
Robin_Watts | platform/android/jni/Application.mk | 14:03.19 |
tor8 | Robin_Watts: ta. | 14:03.36 |
Robin_Watts | The abi is set in there. I suspect it's armeabi-v7a by default. | 14:03.39 |
tor8 | yeah, that was the default. recompiling now. | 14:03.52 |
| fab, now it runs! | 14:09.21 |
| now to get it to actually work :) | 14:09.26 |
| Robin_Watts: if you want to take over, it builds but crashes at runtime in AndroidDrawDevice_newNative | 14:20.22 |
| latest code is on tor/jni | 14:20.27 |
Robin_Watts | tor8: will do. | 14:20.34 |
tor8 | I expect we'll want to squish these commits together before merging | 14:20.37 |
Robin_Watts | Yeah, seems simplest. | 14:20.44 |
mvrhel_laptop | I am out for a bit this morning. | 15:35.26 |
Robin_Watts | tor8: Got a wierd one here. | 16:16.03 |
| I've reinstated AndroidDrawDevice.java, deriving from NativeDevice. | 16:16.34 |
| If I call super(newNative(bitmap, blah, blah, blah, blah)); in the constructor, it complains, saying that newNative only takes 1 argument. | 16:17.09 |
| This is despite the fact that newNative is declared just a few lines later on. | 16:17.31 |
| If I change newNative to newADD, it works fine. | 16:17.43 |
| I think the compiler must be confusing the newNative function defined within AndroidDrawDevice with the newNative function defined in NativeDevice. | 16:18.22 |
| Which makes me worry that other places where we are calling newNative (like say in DisplayDevice) that the compiler might be doing funny things there. | 16:18.48 |
| Hmm. Moving the definition to the top solves the problem. Urgh. | 16:20.03 |
rayjj | leonardo: (for the logs) If kens isn't around, mvrhel is another person that may be able to help with color issues (particluarly ICC profile related questions) | 17:03.35 |
Robin_Watts | tor8: For the logs, I've pushed todays stuff to robin/jni. | 18:58.19 |
| platform/java/Makefile has now been split into several targets. The files are listed explicitly so it works with nmake. We could use wildcards, but we can't use your funky shell stuff. | 18:59.14 |
| To build for android I first nmake mupdf.jar there, then make as usual in platform/android. | 18:59.37 |
| The only change I had to make to the java was to make 'pointer' in Device be a protected rather than a private thing. | 19:00.01 |
marcosw | i need to shutdown casper for about 15 minutes in a bit (sebras and pete are the only ones logged on). | 19:00.15 |
Robin_Watts | I could have had a 'setPointer' function in Device, but I didn't see the point. | 19:00.31 |
| The hacked about android app runs again now. | 19:00.45 |
dalerank | ok, maybe any know how to take function index from js state? | 21:14.10 |
sebras | tor8: Robin_Watts: have a tentative patch for soft hyphens over at sebras/master. do you think this one makes sense? | 22:16.22 |
| I feel that my approach is a bit hackish, but it seems to work at least. | 22:16.57 |
tor8 | ifdef HAVE_ANDROID can be ifdef ANDROID | 23:55.43 |
Robin_Watts | It can. | 23:55.58 |
sebras | tor8: psst, there's a patch for soft hyphens over at sebras/master when you have time to take a look. | 23:55.58 |
Robin_Watts | Calling from the constructor into C, then back from the C into java to set nativeInfo/Resource sounds bad. | 23:56.26 |
| I am tempted by a setPointer method though. | 23:56.41 |
tor8 | Robin_Watts: I think you must've missed to pull http://git.ghostscript.com/?p=user/tor/mupdf.git;a=commit;h=ab7f88075d645083c8a4be9b937992e0c516dfc7 | 23:56.57 |
Robin_Watts | That way pointer can stay private, and no one can read it. | 23:57.03 |
| Yes, I think I must have missed that. | 23:57.10 |
tor8 | no matter, you've done basically everything in that commit | 23:57.15 |
Robin_Watts | sebras: I'll gladly look tomorrow unless tor wants to bagsie it. | 23:58.05 |
tor8 | Robin_Watts: I was thinking more of separate AndroidDrawDevice.newNative and AndroidDrawDevice.init calls, and the AndroidDrawDevice() { super(newNative()); init(); } | 23:58.22 |
| the problem is you can't use any object fields before calling the super() | 23:58.48 |
Robin_Watts | We could do that. Means 2 calls across the JNI boundary. | 23:59.03 |
tor8 | sebras: cool. will take a look soon. | 23:59.12 |
Robin_Watts | I am tempted by the NativeObject idea you had a while ago too. | 23:59.22 |
tor8 | Robin_Watts: same as setPointer. | 23:59.25 |
| Robin_Watts: you mean save on all the destroy() boilerplate? | 23:59.45 |
Robin_Watts | super(0); setPointer(newNative(....)); is only 1 JNI call. | 23:59.58 |
| Forward 1 day (to 2016/02/05)>>> | |