Bug #705

Bug in generating multi-page PDF using ps2raster

Added by Dongdong almost 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:2015-05-13
Priority:NormalDue date:
Assignee:Paul% Done:

0%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.1.x Platform:

Description

This seems to be a bug in GMT 5.1.2 and GMT-dev, repeat this bug using commands below:

$ gmt psbasemap -R0/10/0/10 -JX10c -B1 > map1.ps
$ cp map1.ps map2.ps
$ gmt ps2raster -TF -Fout.pdf map1.ps map2.ps   
Error: /undefinedfilename in (map1.ps map2.ps)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1169/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.07: Unrecoverable error, exit code 1
ps2raster: System call [gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dMaxBitmap=2147483647 -dUseFastColor=true -r300 -sOutputFile='out.pdf' 'map1.ps map2.ps'] returned error 256.

This bug is due to the single quotes surrounding all PS files.

sprintf (cmd2, "%s%s -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite %s%s -r%d -sOutputFile=%c%s.pdf%c %c%s%c",
    at_sign, Ctrl->G.file, Ctrl->C.arg, alpha_bits(Ctrl), Ctrl->E.dpi, quote, Ctrl->F.file, quote, quote, all_names_in, quote);

Remove the quotes surrounding all_names_in, and add quotes to each PS file name may fix this bug.

Associated revisions

Revision 14289
Added by Paul almost 2 years ago

Fix issue #705

Revision 14290
Added by Paul almost 2 years ago

Fix issue #705 in 5.0.2 branch given name change

History

#1 Updated by Paul almost 2 years ago

  • Status changed from New to Resolved
  • Assignee set to Paul

Yes, when we fixed the general problem (people and file names with spaces) we missed this particular section of the code. Fixed in r14290.

#2 Updated by Paul almost 2 years ago

  • Status changed from Resolved to Closed

Closing this puppy.

Also available in: Atom PDF