RE: [ncarg-talk] idt print to xwd file comes out wrong

From: Do, Jong-Gwan <daker_at_nyahnyahspammersnyahnyah>
Date: Wed, 14 Sep 2005 09:02:23 +0900

Hi Kip,

This is related to the fact that C long has 64bit storage for 64bit OS while
long is 32bit in 32bit OS.
XColor struct in X11/Xlib.h has "unsigned long pixel" component and this is used
at NCARG.
XWDColor struct in X11/XWDFile.h has the correct platform independent constant
byte variables.

So change all XColor to XWDColor in ncarview/src/lib/libncarg_ras/xwd.c file.

And change "_swaplong((char *) &xcolors[i].pixel, sizeof(long));" line
to "_swaplong((char *) &xcolors[i].pixel, sizeof(xcolor[i].pixel));".
There are two lines which has the above syntax.

_swaplong in misc.c file assumes long is 4 byte.
But fortunately this causes no problem in NCARG ncarview raster library.

Then recompile NCARG and test your program.

Regards,
Jong-Gwan
 

-----Original Message-----
From: ncarg-talk-bounces_at_ucar.edu [mailto:ncarg-talk-bounces_at_ucar.edu] On Behalf
Of Mary Haley
Sent: Tuesday, September 13, 2005 1:18 AM
To: Kip Smith
Cc: ncarg-talk_at_ucar.edu
Subject: Re: idt print to xwd file comes out wrong

Hi Kip,

The XWD driver in idt is old and I wouldn't recommend using this tool to convert
to XWD files. We might be able to fix this, but it would be a low priority at
this point, since the idt developer is no longer available.

If you want to convert to other formats, like xwd, png, gif, etc, I would
recommend using one of the many free tools out there, like ImageMagick. You can
have your NCAR Graphics output go to a PS or PDF file, and then you can use
these tools to convert to another format.

Meanwhile, if you can send me your NCGM, I can take a quick look at it to see if
I have problems at this end.

Thanks,
\
--Mary

On Thu, 8 Sep 2005, Kip Smith wrote:

>
> I intalled the lastest version of NCAR graphics on my dual Opteron
> workstation running SuSE linux 9.3 and PG FORTRAN 6. I ran several
> programs and they created ncgm files which are the same as on my old
> system. However, when I use idt to print the graphic to an xwd file,
> the xwd image is incorrect (see the attached file which is the xwd
> file converted to png format). The colors are not the ones in the ncgm
> version and this image is offset. What's gone wrong?
>
> Kip Smith
>
_______________________________________________
ncarg-talk mailing list
ncarg-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncarg-talk

_______________________________________________
ncarg-talk mailing list
ncarg-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncarg-talk
Received on Tue Sep 13 2005 - 18:02:23 MDT

This archive was generated by hypermail 2.2.0 : Sat Jan 07 2006 - 13:21:14 MST