COIN-OR::LEMON - Graph Library

Opened 14 years ago

Closed 14 years ago

#336 closed defect (fixed)

graphToEps() generates bad .eps header

Reported by: Alpar Juttner Owned by: Alpar Juttner
Priority: major Milestone: LEMON 1.2 release
Component: core Version: hg main
Keywords: Cc: tapolcai@…
Revision id: f903263902f6

Description

The .eps header generated by 'graphToEps()' contains an empty line after the %%CreationDate: DSC field, at least on linux. This confuses some .eps tools, such as gv.

%!PS-Adobe-2.0 EPSF-2.0
%%Title: Sample .eps figure
%%Copyright: (C) 2003-2009 LEMON Project
%%Creator: LEMON, graphToEps()
%%CreationDate: Thu Jan 21 13:14:18 2010

%%BoundingBox: 485 485 865 715
%%EndComments

Attachments (1)

6e919f777fdb.patch (561 bytes) - added by Alpar Juttner 14 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 14 years ago by Alpar Juttner

Summary: graphToEps() generated bad .eps headergraphToEps() generates bad .eps header

comment:2 Changed 14 years ago by Alpar Juttner

This is the code snippet responsible for printing the %%CreationDate: line

    {
      os << "%%CreationDate: ";
#ifndef WIN32
      timeval tv;
      gettimeofday(&tv, 0);

      char cbuf[26];
      ctime_r(&tv.tv_sec,cbuf);
      os << cbuf;
#else
      os << bits::getWinFormattedDate();
#endif
    }
    os << std::endl;

from this it looks like ctime_r() printed the extra newline, which is a bit weird.

Could someone check whether or not the output of graph_to_eps_demo() is correct on windows?

comment:3 Changed 14 years ago by Tapolcai János

It works fine under Mingw+Windows Vista.

comment:4 Changed 14 years ago by Alpar Juttner

Status: newassigned

Changed 14 years ago by Alpar Juttner

Attachment: 6e919f777fdb.patch added

comment:5 Changed 14 years ago by Alpar Juttner

Cc: tapolcai@… added

[6e919f777fdb] is a fix for this issue. Could anyone check it on Windows (both with mingw and with Visual Studio).

comment:6 in reply to:  5 ; Changed 14 years ago by Peter Kovacs

Replying to alpar:

[6e919f777fdb] is a fix for this issue. Could anyone check it on Windows (both with mingw and with Visual Studio).

It works fine on windows (both with mingw and VS2008).

comment:7 in reply to:  6 Changed 14 years ago by Alpar Juttner

Resolution: fixed
Status: assignedclosed

Replying to kpeter:

Replying to alpar:

[6e919f777fdb] is a fix for this issue. Could anyone check it on Windows (both with mingw and with Visual Studio).

It works fine on windows (both with mingw and VS2008).

Thanks. It has been rebased as [f58e01094738] and merged to branches 1.0, 1.1 and main.

Note: See TracTickets for help on using tickets.