imagemagick - Failed to convert NCL high-resolution postscript to png -


i got postscript file ncl script whit mpdatabaseversion = "highres" (high resolution map). , got imagemagick 6.2.8 run in rhel 5.6 i386.

when ran convert high-resolution.ps test.png, got:

error: /undefinedresult in --ashow--  operand stack:    0   0   ( )  execution stack:    %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_pop   1893   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--  dictionary stack:    --dict:1171/1684(ro)(g)--   --dict:0/20(g)--   --dict:143/200(l)--  current allocation mode local current file position 629039 

but same postscript convert without error in rhel 3 i386 imagemagick 5.5.6, how come?

i googled while, still have no idea undefinedresult in ashow error.
, execution stack means?


[update]

thanks, @fred , @ken !
restructured problem below:

i have big postscript file (9.3 mb): high_resolution.ps

pc a:

  • red hat enterprise linux es release 3 (taroon update 3) i386
  • convert version: imagemagick 5.5.6 04/01/03 q16
  • ghostscript version: gnu ghostscript 7.05 (2002-04-22)

pc b:

  • red hat enterprise linux server release 5.6 (tikanga) i386
  • convert version: imagemagick 6.2.8 05/07/12 q16
  • ghostscript version: gpl ghostscript 8.70 (2009-07-31)

convert high_resolution.ps high_resolution.png works in pc a, not in pc b.

the error above.
, check ghostscript changelog, got nothing (maybe missed ?)

a lots of appreciation! 謝謝!

almost using different versions of ghostscript (which imagemagick uses deal postscript). version of ghostscript have installed on each ?

undefinedresult means says, result of operation undefined (this caused divide-by-zero). execution stack tells on execution stack @ point interpreter encountered error. unless understand postscript (and honest, ghostscript interpreter) doesn't tell meaningful.

i can't more without seeing file causes error. remember, postscript programming language, error messages starting point.

update

i've retrieved file , can confirm error when running through current version of ghostscript. adobe acrobat distiller gives similar error (undefinedresult setcachedevice) practically file illegal. i'll more when i've had chance determine why.

on side note, both these versions of ghostscript elderly, current version 9.07

[update 2]

the offending line near beginning of file :

/helvetica 0 fs 0 0 ( ) gr

because postscript programming language, fragment uses procedures defined in program. find font called 'helvetica', scale size of 0 show string ' ' adjusting width of each glyph 0.

several parts of nonsense; scaling font 0 make useless, @ best glyph mark 1 pixel. showing string using operator adjust width of each glyph 0 pointless. smarter software wouldn't produce such postscript program, producer isn't smart producing postscript can seen rather simple prolog file.

basically problem gs said, x , y widths adjusted using matrix, , result of applying matrix multiplication font size of 0 genuinely undefined.

your best bet go original application , remove whatever causing text ' ' emitted.

if reason impossible, can take advantage of fact postscript programming language, can redefine /ashow operator , have nothing if font size 0, eg:

/old_ashow /ashow load def /ashow {currentfont /fontmatrix aload pop pstack 0 1 4 {pop add} 0 eq {pop pop pop}{old_ashow}ifelse} bind def

normally suggest putting in new file , running through ghostscript in advance of file want process (eg 'gs mod.ps high_resolution.ps') because using imagmagick can't that. if want need modify high_resolution.ps file , put @ top of file. whenever modify postscript files must careful use editor can handle binary, , not alter cr/lf line endings.

please note don't recommend this, better fix original file or script producing postscript program can use in other places (eg printing). stands producing illegal postscript.

as why error not occur (exteremely) old version of ghostscript; oversight. adobe postscript language reference manual lists possible errors each operator, not possible circumstances under error raised. error condition added after release of 7.05, when problem brought developers attention.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -