[GRASS-user] ps.map: include eps (path to file), PS-interpreter

Hello,

I just wanted to include a eps-logo in the ouput of ps.map but it isn't displayed,
so I guess that this has something to do with the path to the file. It seems correct
but there is a space included which my not be accepted by the PS-interpreter.

Is there a way to set a path with space to include eps-files with ps.map?
The way I did was:

eps 1 1
  epsfile /Users/Johannes Radinger/Documents/logo.eps
  scale 1
  end

/thanks johannes

Johannes wrote:

I just wanted to include a eps-logo in the ouput of ps.map
but it isn't displayed, so I guess that this has something
to do with the path to the file. It seems correct but there
is a space included which my not be accepted by the
PS-interpreter.

Is there a way to set a path with space to include
eps-files with ps.map?

The way I did was:

eps 1 1
epsfile /Users/Johannes Radinger/Documents/logo.eps
scale 1
end

Hi,

thanks for the report.

here's the fix:

---8<---
Index: ps/ps.map/do_plt.c

--- ps/ps.map/do_plt.c (revision 46156)
+++ ps/ps.map/do_plt.c (working copy)
@@ -152,7 +152,7 @@
       break;

   case 'E': /* EPS file */
- if (sscanf(buf, "E %d %lf %lf %lf %lf %s",
+ if (sscanf(buf, "E %d %lf %lf %lf %lf %*s",
            &masked, &e1, &n1, &scale, &rotate, name) == 6) {
     if (masked && after_masking)
         continue;
--->8---

sscanf()'s %s stops scanning the buffer at a space so just the
first part was picked up. I'm a little rusty on my formatting
codes but I believe %*s will keep going to the end of the line.
Seems to work anyway. We are rather lucky that the programmer
had the foresight to make the freeform filename the last
parameter of that line; good practice pays off!

@devs: is svn open for commits or should we wait for the SSL
cert renewal to make its way through the system?

Hamish

Hamish wrote:

sscanf()'s %s stops scanning the buffer at a space so just
the first part was picked up. I'm a little rusty on my
formatting codes but I believe %*s will keep going to the
end of the line.

would %[^\n] be better?

Hamish

Johannes wrote:
I just wanted to include a eps-logo in the ouput of ps.map
but it isn't displayed, so I guess that this has something
to do with the path to the file. It seems correct but
there is a space included which my not be accepted by the
PS-interpreter.

Now fixed in all branches, try the next nightly build & please
confirm the fix works for you (personal email is fine) as I didn't
test on MS Windows.

Hamish