[Xastir-Dev] Snapshot problem
Curt Mills
hacker at tc.fluke.com
Fri Jun 6 12:09:47 EDT 2003
On Fri, 6 Jun 2003, Curt Mills, WE7U wrote:
> System that is displaying the problem: xastir_<user>_snap.xpm file
> was 206212 bytes and the permissions looked fine. ".png" file was
> not present.
>
>
> > display xastir_<user>_snap.xpm
> display: Unexpected end-of-file (xastir_<user>_snap.xpm) [No such file or directory].
That was a manual command I ran, in order to check whether the XPM
file was ok. It appears to be truncated.
> > convert: Unexpected end-of-file (/var/tmp/xastir_<user>_snap.xpm) [No such file or directory].
> convert: Missing an image file name.
This was what Xastir printed in the xterm.
> It doesn't look like an ImageMagick problem. It appears that the
> XpmWriteFileFromPixmap() call is not completing properly, perhaps
> leaving a partially written file on disk. I should have snagged
> that XPM file for further diagnostics. I can't get to it right now.
The below is a bit troubling, although not directly related to the
problem above. Our code which attemps to run "convert" to create
the XPM file:
#ifdef HAVE_CONVERT
// Convert it to a png file. This depends on having the
// ImageMagick command "convert" installed.
xastir_snprintf(command,
sizeof(command),
"%s -quality 100 -colors 256 %s %s",
CONVERT_PATH,
xpm_filename,
png_filename );
if ( system( command ) != 0 ) {
// We _may_ have had an error. Check errno to make
// sure.
if (errno) {
fprintf(stderr, "%s\n", strerror(errno));
fprintf(stderr,
"Failed to convert snapshot: %s -> %s\n",
xpm_filename,
png_filename);
}
}
I did not see the "Failed to convert snapshot" message. This means
that ImageMagick's convert didn't return an error code in "errno"?
Is ImageMagick not playing by the rules (again)? I guess I'll add
yet another error message to see if the system call is returning
with an error.
--
Curt Mills, WE7U hacker_NO_SPAM_ at tc.fluke.com
Senior Methods Engineer/SysAdmin
"Lotto: A tax on people who are bad at math!"
"Windows: Microsoft's tax on computer illiterates!" -- WE7U
"The world DOES revolve around me: I picked the coordinate system!"
More information about the Xastir-dev
mailing list