| <<<Back 1 day (to 2014/06/04) | 2014/06/05 |
ecw | Hello. I have a question: Is it possible to get with ghostscript and MuPDF the size on an image inside of an PDF Document and also the DPI Size? | 10:22.16 |
kens | Images don't really have a 'dpi' when embedded in a PDF file | 10:23.12 |
| THey are given dimensions wto be drawn into (eg 10cm x 10cm) and then there are a number of image samples, given as a width and height (ag 1000x1000) | 10:24.02 |
| You cna then calculate that, when drawn at that size, the image is 100 samples per centimetre | 10:24.33 |
ecw | Thanks for this really fast answer. I do not exactly understand what you wrote. | 10:27.03 |
| Can you give me an example how I can calculate the DPI? | 10:27.21 |
kens | I just did, see above | 10:27.40 |
| Lets take it in inches if it will make it easier for you | 10:27.51 |
ecw | Can we calculate the DPI from the Pageformat? | 10:27.55 |
kens | Say I have a PDF file and the PDF file contains an image. | 10:28.04 |
ecw | okay | 10:28.16 |
kens | THat image is drawn with a CTM which draws it 2 inches by 2 inches on the page | 10:28.27 |
| THe image data is declared so that the image has a width of 100 samples, and a height of 100 samples. | 10:28.55 |
| We can then say that there are 50 samples per inch (100 / 2) | 10:29.14 |
ecw | what is a sample? | 10:29.25 |
kens | An image pixel | 10:29.35 |
ecw | okay. THanks | 10:29.51 |
kens | But we prefer to describe these as sampels to avoid confusion with dpi | 10:29.57 |
ecw | ahh okay | 10:30.04 |
danre | Hi folks! I searched through the entire internet, but I did not find the answer to my question. Is it possible to build the library libmupdf.so for linux (e.g. ubuntu)? I am writing a program in C#(mono), and it uses call functions via dllimport. In Windows it works fine, uses libmupdf.dll. But in Ubuntu causes "dll not found exception: libmupdf". I downloaded the source code and `make` it. In `/build/debug` folder I found a lib | 10:30.31 |
| I exec `ld -shared -s -o libmupdf.so --whole-archive libmupdf.a`. However, thus obtained .so does not operate. I copied it to /usr/lib and exec `ldconfig`. What am I doing wrong? And is there any easy way to get a shared library libmupdf.so? Sorry for my english, I use google translate. | 10:31.03 |
kens | You can't really say that an image has a resolution, you can say how many pixels there are in each direction, tbui the dpi depends on how many pixels each image sample covers on the output. | 10:31.05 |
ecw | Okay. Here I have three PDF Documents: http://magoch.com/pdf/ These have to be checked for some special thinks. Is that possible? | 10:32.16 |
kens | ecw how canI tell, I have no idea what 'special things' you need to check for | 10:32.44 |
ecw | Okay there we have the 3rd file. | 10:33.13 |
| This file has less than 72dpi | 10:33.32 |
| we have to check if this file has less than 72 or more. | 10:33.51 |
chrisl | danre: as far as I'm aware, our makefiles don't support mupdf as a shared lib - that's something added by the linux distros which we don't support | 10:33.58 |
kens | ecw PDF files don't have a resolution, therefore it can't have 'less than 72 dpi' | 10:34.29 |
chrisl | danre: you may be able to follow the same method as you tried by adding the "-fPIC" option to the CFLAGS in the mupdf makefile | 10:35.07 |
kens | It is possible that, the image data will cover more than 1 pixel, when pritned at 72 dpi | 10:35.09 |
chrisl | danre: I would also note that mupdf makes no attempt to maintain ABI compatibility with previous releases, so it's possible that replacing an old shared lib with a new one won't work | 10:36.33 |
ecw | okay. For your understanding. I'm not a guy who knows really good about DPI and so on. But i have to develop to check the pdf documents and to say if a pdf document contains a picture where the picture has less than 72 dpi or more than 72 dpi. Is there a possibility? | 10:37.48 |
kens | I think I'm about to be stuck with using the gmail web interface :-( | 10:39.50 |
chrisl | kens: why, has Eudora finally conked out on you? | 10:40.52 |
ecw | hey kens | 10:41.22 |
| For your understanding. I'm not a guy who knows really good about DPI and so on. But i have to develop to check the pdf documents and to say if a pdf document contains a picture where the picture has less than 72 dpi or more than 72 dpi. Is there a possibility? | 10:41.32 |
kens | chrisl my mail stopped coming through to Eudora from Gmail, so I tried configuring it to use IMAP, now it tells me my password is incorrect. So I tried using Thunderbird and it *also* tells me my password is incorrect. SO I tried changiung my password, and gmail tells me my original password (which I use to login with) is incorrect..... | 10:42.26 |
| chrisl so I tried to set up mail forwarding to my regular account. THe URL in the confirmatiion email tells me my gmail is 'temporarily unavailable' and the confirmation code, when pasted into the gmail settings, is 'incorrect'; | 10:43.22 |
| ecw you need to learn about DPI if you want to understand what I'm saying. You can't simply ask what the dpi of an image is, because it depends how large you print it. | 10:44.06 |
chrisl | kens: you may need to just wait a while.... I regularly get gmail erroring out on the IMAP connection, and it usually works again after a little while. | 10:44.38 |
kens | If I print a given image at 1 inch square then its one reoslution, if I print it at 10 inches square on the same printer, then its resolution is 1/10 of what it wa. But its the same image.... | 10:44.40 |
| chrisl but the confirmation code, pasted into the gmail settings is identified by Google as 'incorrect'..... | 10:45.38 |
| Of course, its possible that Gmail is knackered, the reason I started hti s is because it wa delivering the last 5 days emails slowly. Every time I checked mail it woudl deliver one or two emails, then no more for several minutes. | 10:46.43 |
ecw | @ kens: I have to be for an half an hour away. Can I ask you than again? | 10:47.07 |
kens | ecw you can ask | 10:47.22 |
ecw | Thanks! See you in half an hour :) | 10:47.33 |
chrisl | kens: I seem to remember having all sorts of problems when I went through the "reset password" process - unfortunately, I can't remember how I resolved it. | 10:48.21 |
kens | That's another problem of course...... | 10:48.42 |
| This gmail software is just terrible :-( | 10:48.58 |
| And I'm sure its getting worse..... | 10:49.05 |
| And unlike real mail software, I can't forward an individual email :-( | 10:49.33 |
chrisl | gmail regularly gets its knickers in a twist because I often have two IMAP clients open at the same time (tbird on two computers). It gets uppity and blocks both of them until I shut both down, and restart just one..... rather defeats one of the benefits of IMAP, IMHO! | 10:52.24 |
kens | Great, so I now have mail forwarding set up, hopefully any *new* mail will get forwarded, but I still can't do anythign with the mail stuck in my Inbox. | 10:57.38 |
| OK it seems that I can forward an email, I have to open the email in the web intrface, then I can forward it, individually..... | 11:00.46 |
danre | +chrisl: thanks for the answer!I just added an "-fPIC" option to the CFLAGS in the mupdf makefile, then `make`. Build success. But on command `ld -shared -s -o libmupdf.so --whole-archive libmupdf.a` now there are errors like: | 11:01.58 |
| libmupdf.a(buffer.o): In function `fz_write_buffer_rune': /home/danre/SVN/mupdf/mupdf-1.4-source/source/fitz/buffer.c:153: undefined reference to `__stack_chk_fail_local' | 11:02.08 |
| libmupdf.a(colorspace.o): In function `fz_std_conv_pixmap': /home/danre/SVN/mupdf/mupdf-1.4-source/source/fitz/colorspace.c:943: undefined reference to `__stack_chk_fail_local' | 11:02.30 |
| libmupdf.a(crypt-aes.o): In function `aes_crypt_cbc': /home/danre/SVN/mupdf/mupdf-1.4-source/source/fitz/crypt-aes.c:526: undefined reference to `__stack_chk_fail_local' libmupdf.a(crypt-md5.o): In function `fz_md5_final': /home/danre/SVN/mupdf/mupdf-1.4-source/source/fitz/crypt-md5.c:272: undefined reference to `__stack_chk_fail_local' | 11:02.55 |
chrisl | danre: okay, so your best option would be to grab the mupdf source package for you distribution, and have a look at what patches they apply to get the shared lib out of it | 11:05.01 |
tkamppeter | Anyone can help me on this bug: http://bugs.ghostscript.com/show_bug.cgi?id=695290? If you give GS more memory for rendering, the output has wrong colors and with a lower amount of memory it is correct. | 11:52.04 |
kens | Can you reproduce it with some device other than CUPS ? | 11:52.41 |
ecw | Hello kens. Okay to talk again about my problem. we have in a pdf document a picture with a special size. But this picture has not enough DPI. We need this to check the PDF Document from customers who will upload PDF Documents like that. | 11:53.28 |
tkamppeter | kens, I did not try. I only saw this report in the last days. | 11:53.35 |
kens | tkamppeter : I'd try a different device, if you cna reproduce it there then its our problem. If you can't then at least you know its something odd that the cups device is doing. | 11:54.25 |
| ecw As I keep pointing out, there is no 'dpi' in a PDF file. DPI is only relevant when you come to print. | 11:54.52 |
| If I have an image which is 1000 pixels wide and 500 pixels high, what is its dpi ? | 11:55.14 |
ecw | Okay. The File will be used afterwards for Printing | 11:56.25 |
Robin_Watts | chrisl, tkamppeter: Did the problems with tkamppeters last commit get resolved? | 11:59.11 |
chrisl | Robin_Watts: I've no idea..... | 12:00.50 |
Robin_Watts | chrisl: I thought that you said you'd backed out tkamppeters latest commit ? Or did I misunderstand ? | 12:02.43 |
| I think I must have misunderstood. | 12:03.38 |
chrisl | Robin_Watts: I did, and it was re-committed in such a way that the cluster works, but I think James Cloos spotted another problem with it... | 12:03.39 |
Robin_Watts | no, that wasn't the latest commit, AIUI. | 12:03.57 |
| The latest commit is the encode/decode color one, and that's still there AFAICT. | 12:04.09 |
chrisl | That wasn't the commit I was talking about at the meeting | 12:04.52 |
kens | chrisl ping | 12:14.56 |
chrisl | kens: pong | 12:15.14 |
kens | could you send an email to my artifex mail acount please ? | 12:15.32 |
chrisl | Done | 12:16.00 |
kens | thanks,mail forwarding seems to be working now, so I think I'll live with that. Anythign that measn I don't have to use the gmail web interface..... | 12:16.48 |
Robin_Watts | chrisl: yeah, so I was misunderstanding. | 12:16.54 |
ecw | Hi Kens. Okay now I think I understood dpi and so on: My question: A customer is building a pdf-document and will build the PDF Document with the size 1525mm x 3050mm (59,475 x 118,95 inch). Now in this PDF Document is a picture over the complete size of the document. This Picture has now a size. To have completely 72 dpi we need to have a picture in the size (4283 x 8565 px). | 12:53.22 |
| So what we have to get out of a pdf document is: The formatsize of the pdf document and the size of the image in the pdf document | 12:53.48 |
| Is this possible with ghostscript` | 12:55.13 |
| ? | 12:55.14 |
kens | You cna get that from Ghostscript but its not trivial, you can also do so with MuPDF< but I have no idea how hard that would be. I suspect that other tools exist which will return that information as well | 12:55.18 |
Robin_Watts | ecw: Is it a single image? Or is it a set of images that tile to make up the page? | 12:55.46 |
ecw | no it is a single image | 12:55.57 |
kens | A simple grep woudl probably do then. Look for /Height and /Width | 12:56.17 |
Robin_Watts | Then you basically need to check every image in the file to see that it's at least the required size. | 12:56.52 |
| A simple grep won't cope in all cases. | 12:57.02 |
| but it'll do most, yes. | 12:57.14 |
| If you need to write a generic tool for this, I'd use mupdf, and implement an fz_device. | 12:57.49 |
tkamppeter | Robin_Watts, chrisl, with my last commit I have applied a patch from James Cloos (slightly modified) to fix bug 695264. Now GS (with up-to-date libcups) emits correct PWH Raster for DeviceGray, DeviceRGB, and DeviceCMYK color spaces with 1, 8, and 16 bit per color. | 12:57.57 |
Robin_Watts | tkamppeter: Your last commit was: "cups" output device: Do byte-swapping for correct Endian not only for EncodeLUT... | 12:59.00 |
tkamppeter | Robin_Watts, chrisl, the other bug opened by James Cloos is bug 695273 and this is about missing support for sGray, sRGB, and AdobeRGB color spaces, completely independent of my patch. | 12:59.20 |
| Robin_Watts, yes, that patch fixes bug 695264. | 12:59.43 |
Robin_Watts | Right, but that wasn't from James Cloos. | 13:00.04 |
tkamppeter | Robin_Watts, sorry, it was yours, how did I come to James Closs. | 13:00.29 |
Robin_Watts | At the staff meeting the other day, I caught the tail end of a conversation that lead me to believe that that patch had been backed out. I was wrong, hence my comments this morning. | 13:01.09 |
tkamppeter | Robin_Watts, this patch is great and got me half way to GS supporting PWG Raster correctly. Thanks again. | 13:01.12 |
Robin_Watts | tkamppeter: Cool. When you get the rest of the way there, feel free to mail me patches to cluster test. | 13:01.51 |
tkamppeter | Robin_Watts, chrisl, the other half is to get bug 695273 fixed. | 13:01.58 |
Robin_Watts | (Or lookup the instructions for the cluster in the irc logs and test it yourself) | 13:02.19 |
chrisl | tkamppeter: my concern is that none of these commits were regression tested before being pushed to the repo - it is our de facto standard practice to regression test changes before they go into the repo. | 13:02.25 |
tkamppeter | Robin_Watts, chrisl, kens, anyone already working on updating the built-in libcups? | 13:04.36 |
kens | No, the latest consensus is to simply drop it, its only present to allow debugging on Windows | 13:05.01 |
chrisl | tkamppeter: I haven't looked at it yet - I've other things to work on | 13:05.34 |
henrys | interesting to see the dell venue support request I didn't know that was atom based. | 13:17.00 |
kens | hasn't a clue what henrys is talking about.... | 13:17.59 |
| Oh SOT... | 13:18.20 |
tkamppeter | chrisl, kens, for me the built-in libcups can be simply dropped, independent on this one should perhaps let the build system check which libcups is used for the build and if it is too old, build without the pwgraster output device. | 13:50.41 |
| Robin_Watts, ^^ | 13:50.55 |
kens | tkamppeter : that is probably true for Linux, but not Windows | 13:51.49 |
chrisl | tkamppeter: if we drop the the built-in libcups, that will hamper our ability to debug the stranger color spaces that CUPS uses | 13:52.16 |
henrys | chrisl: we haven't done anything with it for ages and it would be nice to be rid of it. | 15:03.44 |
| chrisl: I guess Robin_Watts looked at encode and decode color recently. | 15:04.26 |
tkamppeter | chrisl, kens, OK. | 15:06.42 |
chrisl | henrys: I'm confused - it was at your insistence that we included it in the first place | 15:09.54 |
henrys | chrisl: yes it hasn't brought me the joy I predicted it would ;-) | 15:11.59 |
| chrisl: I really don't feel strongly one way or the other though. | 15:13.05 |
chrisl | My worry is that there are a couple of color issues pending, and if either of those nee input from Michael..... | 15:14.31 |
| henrys: ^^ | 15:14.36 |
henrys | chrisl: well that's reason enough to leave it in for now | 15:15.46 |
Robin_Watts | tor8: 2 commits on robin/master (and 3 that aren't ready). | 15:29.16 |
| Those are the fruits of the flight to SF. | 15:29.32 |
chrisl | tkamppeter: what version of cups did the pwgraster stuff come in? | 15:39.36 |
tkamppeter | chrisl, I must look ... | 15:49.13 |
chrisl | tkamppeter: I *think* it's 1.5, from what I see | 15:49.34 |
tkamppeter | chrisl, according to comments in /usr/include/cups/raster.h CUPS 1.5. | 15:52.44 |
chrisl | tkamppeter: super, thank you | 15:52.59 |
tkamppeter | chrisl, /usr/include/cups/raster.h contains "# define CUPS_RASTER_HAVE_PWGRASTER 1" in versions which support PWG Raster, so the build system could use this to decide whether the "pwgraster" output device should be included. | 15:54.25 |
chrisl | tkamppeter: I had really hoped to just use the output from cups-config | 15:55.05 |
tkamppeter | chrisl, if you update the built-in libcups, simply use the current one, to have as many as possible bugs fixed and to be prepared for other new features which could be useful. | 15:55.50 |
| chrisl, should also work, as the comment says from 1.5 on. | 15:57.00 |
chrisl | tkamppeter: that's what I'm doing. But this is a different thing...... | 15:57.20 |
| kens: ping | 16:09.54 |
kens | pong | 16:09.57 |
chrisl | kens: when you have a moment (tomorrow is fine) can you pull master from my repo, and try building on Windows, please? | 16:10.31 |
kens | I can do it now if you walk me through it :-) | 16:10.57 |
chrisl | Er, git pull --rebase chrisl master - assuming you called my repo "chrisl" | 16:11.27 |
kens | I did, just a moment | 16:11.42 |
chrisl | There should be three new commits | 16:12.13 |
kens | gave me an error unable to unlink gs/cups/libs/cups/adminutil.c | 16:12.52 |
| permission deied error | 16:13.06 |
chrisl | That's weird :-( | 16:13.44 |
kens | I guess I can delete it myself | 16:14.01 |
chrisl | I'm guessing you don't have that file open for any reason | 16:14.20 |
kens | Hmm seems to be OK this time | 16:14.21 |
| OK I see 3 cups revisions, you are missing my latest PDF interpreer revision | 16:14.50 |
| I've sent VS off to build the solution | 16:15.09 |
chrisl | I don't think I am missing any commits - your "ignore broken appearance dicts" one is there | 16:16.02 |
kens | Oh yes, I must have missed it | 16:16.23 |
chrisl | Phew, you had me worried | 16:16.44 |
kens | VS is still burbling away to itself.... | 16:16.53 |
chrisl | I had an odd one: I got a missing symbol on GetNativeSystemInfo() - and I really think it should be there in VS2005 on a post WinXP windows..... | 16:18.02 |
kens | OK 4 succeeded, 1 failed, let me look closert | 16:18.26 |
| ghostsvg fails | 16:20.35 |
| Presumably because its been removed :-) | 16:20.45 |
chrisl | Seems likely | 16:20.57 |
kens | I have an old reference in my custom copy of the solution | 16:21.02 |
| So GS builds fine | 16:21.13 |
chrisl | Can you build with WITH_CUPS=1 | 16:21.26 |
kens | Just GS ? | 16:21.33 |
chrisl | Yeh, only gs builds cups | 16:21.59 |
kens | OOps, letme cleanit first | 16:22.14 |
| Well that built OK. | 16:25.01 |
| Is there a .obj file I can check to see if it actually compiled cups in ? | 16:25.16 |
chrisl | if you do gswin32c.exe -h it will list the cups and pwgraster devices | 16:25.59 |
kens | I don';t see them there | 16:26.06 |
chrisl | Well, I guess it didn't build cups then :-( | 16:26.39 |
kens | I added WITH_CUPS=1 to the preprocessor definitions, that should have been enough ? | 16:26.43 |
chrisl | Ah, no, WITH_CUPS=1 is an nmake parameter | 16:27.05 |
kens | Oh, OK, then give me a minute | 16:27.18 |
| More things to change that way | 16:27.25 |
chrisl | How are we supposed to resolve warnings like: "incompatible pointer types passing 'bool *' to parameter of type 'bool *'" | 16:28.38 |
kens | cast them both to void :-) | 16:28.54 |
chrisl | And macpro is showing a build error :-( | 16:29.49 |
kens | that build failed chrisl | 16:29.58 |
| debug_filter undeclared indentifier | 16:30.19 |
| 1>cups\libs\cups\debug.c(607) : error C2065: 'regex_t' : undeclared identifier | 16:30.41 |
| 1>cups\libs\cups\debug.c(607) : error C2059: syntax error : ')' | 16:30.41 |
| 1>cups\libs\cups\debug.c(608) : error C2065: 'debug_filter' : undeclared identifier | 16:30.41 |
| and a warning: | 16:31.02 |
| 1>cups\libs\cups\debug.c(608) : warning C4047: '=' : 'int' differs in levels of indirection from 'void *' | 16:31.02 |
henrys | chrisl: I did update Mac Pro I may have to install something | 16:31.41 |
kens | chrisl debug_filter is only defined when #ifndef WIN32 | 16:32.15 |
| Lines 537, 542, 605, 608 | 16:32.53 |
chrisl | henrys: no, it looks like some of the cups API calls have been deprecated.... I think that's the problem, although no "errors" are actually listed | 16:32.57 |
| kens: I wonder how it worked for me..... | 16:33.05 |
kens | chrisl no idea. The regex_t will go away at the same time as its inside a 'debug_filter' test | 16:33.38 |
| likewise the sytaxror I think | 16:34.11 |
| line 452 properly guards the debug_filter with a #ifndef WIN32 | 16:34.49 |
| as does line 636. The other locations don't | 16:35.25 |
chrisl | kens: Okay, I'll tweak it for Windows. It's not so important as I'll need to resolve the macpro errors before I commit | 16:36.02 |
kens | OK I did just put guards round the areas in the code here and I'm rebuilding | 16:36.21 |
| chrisl with that minor change it builds and I can see the cups debice and pwgraster in the device list | 16:37.55 |
| Now, how do I put my checkout back to master ? | 16:38.12 |
chrisl | kens: you have no local changes other than those cups tweaks? | 16:38.49 |
kens | Robin_Watts : I would suggest not replying to #695297 until we hear from our *actual* customer that this is a question on their behalf | 16:38.59 |
| chrisl I had already stashed them. | 16:39.10 |
chrisl | kens: then git reset --hard HEAD^^^ | 16:40.15 |
kens | OK thanks | 16:40.20 |
| Looks good | 16:40.40 |
chrisl | kens: that's two bugs they've opened - should I put a note in private comments? | 16:41.08 |
kens | I'm doign it now :-) | 16:41.16 |
| OK got to go, goodnight all | 16:42.26 |
chrisl | g'nite | 16:42.31 |
tkamppeter | Robin_Watts, I have added a patch to http://bugs.ghostscript.com/show_bug.cgi?id=695273. Can you please cluster-test it? | 21:18.28 |
Robin_Watts | wonders if ray is suffering from jet lag. | 23:20.23 |
| Forward 1 day (to 2014/06/06)>>> | |