Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2019/06/19)Fwd 1 day (to 2019/06/21) >>>20190620 
ray_laptop furras: (for the logs) Ghostscript doesn't accept JPEG input files directly: you can use: gs-926-linux-x86 -sDEVICE=eps2write -o xxx.eps lib/viewjpeg.ps -c "(xxx.jpg) viewJPEG"05:11.40 
  furras: note that -dSAFER may cause the reference to xxx.jpg to throw an invalidaccess error05:12.34 
  you can add -I./ to the command line (or -I___ where ___ is wherever the input file is) to have Ghostscript automatically add ___ to the path to the xxx.jpg file)05:14.16 
Keita Dear Ghostscript developers, I'm sorry if you see the following message multiple times. I already sent it to gs-devel@ghostscript.com, but it hasn't come up yet at the archive https://ghostscript.com/pipermail/gs-devel/05:44.47 
  I'm afraid that it didn't make its way to the ML, possibly because it was classified as a spam and discarded.05:45.27 
  I'd like to ask you for help to restore functionality of preview-latex, which uses Ghostscript to show math formulae images in Emacs buffer of LaTeX documents. I'm one of developers of AUCTeX, which has preview-latex as its subsystem: https://www.gnu.org/software/auctex/ .05:46.00 
  Let me begin with overview of the problem we (AUCTeX developers) want to address. It was reported recently that preview-latex does not work under certain circumstances: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35571 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35696 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36039 In short, Ghostscript stops with error when preview-latex tries to adjust the foreground color of the gener05:46.43 
  Emacs face.05:47.03 
  We consider the reason of the problem is that preview-latex relies on GS_PDF_ProcSet, which was removed in Ghostscript 9.27, from the following three observations:05:47.21 
  (1) Preview-latex works well when the user downgrades to gs-9.26: https://lists.gnu.org/archive/html/bug-auctex/2019-05/msg00034.html05:47.34 
  (2) Typical error message (quoted at the last of this message) tells that "GS_PDF_ProcSet" caused the error and I found that the official Ghostscript document says "We eliminated GS_PDF_ProcSet": https://www.ghostscript.com/doc/9.27/History9.htm05:48.04 
  (3) The only function which uses GS_PDF_ProcSet in the preview-latex source is called only when the default face of Emacs has non-trivial foreground color and preview-latex tries to adjust the foreground color of the generated image to be the same as that. In fact, I encounter no errors even with gs-9.27 when I use preview-latex with standard foreground color (black) in Emacs.05:48.21 
  Assuming the above consideration is correct, we would appreciate if you, the Ghostscript developers, could kindly provide alternate Postscript code to achieve the original purpose of preview-latex. The relevant elisp code is:05:48.39 
  (defun preview-pdf-color-string (colors) "Return a string that patches PDF foreground color to work properly." ;; Actually, this is rather brutal. It will only be invoked in ;; cases, however, where previously it was not expected that ;; anything readable turned up, anyway. (let ((fg (aref colors 1))) (if fg (concat "/GS_PDF_ProcSet GS_PDF_ProcSet dup maxlength dict copy dup begin\ /graphicsbeginpage{//graphicsb05:48.58 
  (Oops, indentations are totally lost here...)05:49.30 
  What we would like to know is the code (string) to replace the "/GS_PDF_ProcSet GS_PDF_ProcSet dup..." part. Unfortunately, I don't understand any Postscript language, but I hope that the above piece of code together with the error message quoted at the last of this message is enough to determine what to do, even without knowledge of elisp. Please note that these codes go through pdf2dsc.05:49.48 
  If the given information is not enough, feel free to ask us any additional materials.05:50.08 
  contact address: auctex-devel@gnu.org05:50.41 
  GS>{<</PermitFileReading[(tst-prv.pdf)(tst-prv.prv/tmpgIMQ85/preview.dsc)]>> setuserparams .locksafe} stopped pop {DELAYSAFER{.setsafe}if}stopped pop/.preview-BP currentpagedevice/BeginPage get dup null eq{pop{pop}bind}if def<</BeginPage{currentpagedevice/PageSize get dup 0 get 1 ne exch 1 get 1 ne or{.preview-BP 0.925795 0.925795 0.925795 setrgbcolor clippath fill 0.17969 0.203128 0.210941 setrgbcolor}{pop}ifelse}bind/PageSize[105:51.45 
  ew-ST[count 4 roll save]def dup length 0 eq{pop}{setpagedevice}{ifelse exec}stopped{handleerror quit}if .preview-ST aload pop restore}bind def /GS_PDF_ProcSet GS_PDF_ProcSet dup maxlength dict copy dup begin/graphicsbeginpage{//graphicsbeginpage exec 0.17969 0.203128 0.210941 3 copy rg RG}bind store end readonly store (tst-prv.prv/tmpgIMQ85/preview.dsc)(r)file /.preview-ST 1 index def dup 0 setfileposition 415()/SubFileDecode fi05:52.43 
  setfileposition 53()/SubFileDecode filter cvx<<>>preview- do05:53.08 
  Error: /undefined in GS_PDF_ProcSet Operand stack: GS_PDF_ProcSet Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --d05:53.25 
  )-- --dict:77/200(L)-- Current allocation mode is local Last OS error: No such file or directory Current file position is 64105:53.54 
  Best regards, Ikumi Keita05:54.18 
Brenkuu Morning :)07:42.13 
  I was wondering if there were any pre-done resources I might be able to get from you guys?07:42.27 
  I'm looking for something like a simple VBScript or Python script which can do something like; Monitor a folder, and then when a .PS file appears there, ghostscript runs based on the parameters I want.07:43.16 
  I'm sure this has been needed many times in the past :)07:45.01 
  So I figured, why re-invent the wheel if someone has something I can adapt perhaps. 07:45.16 
chrisl Brenkuu: It's not something we've ever supplied.07:45.58 
Brenkuu oh :/07:46.14 
  I suck at programming.07:46.17 
  I was really hoping for some guidance xD07:46.39 
chrisl Well, personally, I would start with google....07:48.01 
Brenkuu Sure, I've done some digging. It's just time consuming and again, hoped someone had something for a situation like this :)07:54.05 
  I assume it's commonly needed.07:54.13 
chrisl Keita: I can't make sense of lengthy Postscript posted on IRC.... TBH, it's to be expected if you use non-standard stuff intended to be only referenced only internally, you'll run into such problems.08:18.59 
  There may well not be a simple "replace GS_PDF_ProcSet...." solution08:19.31 
Keita Yes, this is my first time to use irc and not accustomed to it. I just pasted the content of the mail which was not delivered to gs-devel ML. Maybe I should just provide link to https://lists.gnu.org/archive/html/auctex-devel/2019-06/msg00009.html, which was delivered by Cc:auctex-devel@gnu.org .09:08.56 
  I'd like to find some good way to resolve this problem, along with the sentence "If you encounter such a case, please contact us (either the #ghostscript IRC channel, or the gs-devel mailing list would be best), and we'll work with you to either find an alternative solution." at https://www.ghostscript.com/doc/9.27/History9.htm09:11.01 
kens We're willing to work with you, but not to the extent of simply restoring the old functionality. It was removed for a reasona dn you really should not be fiddling with the internals of the PDF itnerpreter.09:16.42 
  If you can provide a PDF file that dmonstrates the problem, and explain why its a problem then we can look at it, but no, we aren't going to put back the ability to oerride the PDF itnerpreter internals09:17.24 
  Keita, are you subscribed to the gs-devel mailing list ? If not then your mail will be black-holed09:18.41 
Keita No I'm not subscribed.09:22.35 
kens Then that is why your email didn't make it. Only subscribers are allowed to post to the mailing list, its a simple measure against spam09:23.09 
  I'd suggest you subscribe to the list and mail us again. Its easier to reply to an email than to type in IRC.09:23.39 
Keita I see, then next time I post, I'll subscribe.09:24.12 
  Thanks for your advice.09:24.22 
kens However, things to note; allowing applications to change the internals of the PDF itnerpreter is not going to happen. The whole point of removing that dictionary was for security. We can't allow applications to meddle with the interpreter like that, its a total bypass of security.09:24.36 
  If you supply us a PDF file which causes you a problem, and explain why its a problem, we can discuss it.09:25.09 
  And try to come up with some reasonable alrternative09:25.27 
Keita I don't think that the PDF file itself is not problematic. Preview-latex process the PDF, generated by pdflatex with "preview" package with tons of options, via pdf2dsc and uses its output, it seems.09:27.29 
kens To be honest, from your description, it sounds like the problem is in 'preview' or pdflatex. I can't see why hacking the PDF itnerpreter to return the wrong oclour is the correct approach09:28.37 
  The output from pdf2dsc is simply a 'PostScript' file which can only be read by Ghostscript.09:29.07 
  Note that we had to fix the pdf2dsc program09:29.22 
  There's a commit for it somewhere, let me look09:29.35 
  http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=db24f253409d5d085c2760c814c3e1d3fa2dac5909:30.04 
  I can't recall if that made it into the release or not.09:30.13 
  Looks like it did09:30.35 
  Keita: I don't speak lisp or elisp so I don't understand the code you've posted last night, its also not easy (as chrisl said) to read lenghty chunks of PostScript in the IRC log.09:32.18 
  Also chunks of the code you are supplying seem to be missing form hte log which makes it even harder to figure out09:32.47 
  Reading the log again I don't htink pdf2dsc is relevant.09:33.45 
Keita Yes, the elisp code was truncated (because I'm using web interface at http://webchat.freenode.net/?channels=ghostscript&uio=d4?) and I didn't notice that fact at that time.09:34.04 
kens The relevant PostScript is quoted later I think.09:34.27 
  The p[roblem is I can't tell you how to replace that code.09:34.38 
  Firstly because I have no idea why you are doing it.09:34.48 
  What is being done there looks simply wrong to me.09:34.59 
  Its setting the inital page colour to a specific RGB colour for both stroke and fill09:35.32 
Keita I'm using this web irc because the mail I posted wasn't delivered to gs-devel ML. 09:35.43 
kens Yes, which is why I suggested you subscribe to gs-devel and try again, the log is really ahrd to read09:36.07 
Keita Now I see the reason, I'll subscribe to the ML temporarily and post there.09:36.10 
chrisl I'm of surprised that stuff with GS_PDF_ProcSet ever worked at all.....09:37.09 
kens It seems to be redeffining the routine /grphicsbeginpage so that the initial colour is not wjhite, maybe09:37.48 
  I'm not certain why anyone would want to do that, and as I said it looks plain wrong to me. The initial colour s defined in the spec IIRC.09:38.35 
chrisl Oh, it's not a "real" ProcSet09:39.01 
kens Nope :-)09:39.20 
chrisl Well, that's a dumb-ass thing to call it!09:39.34 
kens I think the name is a historical fossil from the days when we used to prepend it to PDF files to prcess them. Decades old09:39.56 
ator Keita: how does preview-latex get the output of gs into an emacs window?10:22.10 
Keita ator: Which do you mean by "output of gs", the generated PNG files or error message from gs? The former are picked up by emacs and displayed in the buffer with the help of libpng linked with emacs executable. The latter are inserted in the process communication buffer of emacs, using standard process I/O facility of emacs.10:46.39 
kens Keita: I've got your email, thanks for that, I'm in the middle of another problem right at the moment but I'll get back to you as soon as I can, I'll try and make it today.10:57.42 
ator Keita: the PNG files. you can use imagemagick to tint the colors of the PNG before passing them on, and not need to mess with GS internals.10:59.48 
  Keita: convert -color-matrix 'R 0 0 0 G 0 0 0 B' input.png output.png11:00.19 
Keita kens: Thanks, I'll wait.11:04.23 
  ator: Thanks for your suggestion. However, I think solutions not dependent on other tools like ImageMagick will be preferrable. Not all systems have ImageMagick installed.11:06.56 
kens Keita, I'm sorry but I'm really going to need an example PDF file and a Ghostscript command line tht I can use to see the difference between the regular rendering and the rendering after the 'preview' hackery with /graphicsbeginpage. It would help a lot to have acutal values for the "(mapconcat #'preview-gs-color-value fg " ")" line, I'm assuming from context that that will be three real numbers.12:29.36 
robtow Two Ghostscript question:s (1) how to force text to render always to black? (2) How to force vector fills to always render to white?19:02.26 
  I tried using options in a <-sGraphicICCProfile> file, but failed. 19:04.02 
  "Ghostscript_921_Color_Management_WhitePaper.pdf" has tantalizing hints about this, but no clear examples.19:04.37 
  /msg NickServ REGISTER Njsboeb19 robtow@tauzero.com19:08.00 
  Hello; is anyone here?22:37.35 
  I am looking for a method to force type in a PDF to always render as blkack to a 24bit TIFF output, despite the color associated with the type object in the PDF fgile.22:40.03 
  I tried using ICC profiles and failed.22:40.43 
 <<<Back 1 day (to 2019/06/19)Forward 1 day (to 2019/06/21)>>> 
ghostscript.com #mupdf
Search: