Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] XBM to GIF conversion

Absolutely, I discussed this a few months ago with someone but I had to
put work on them aside for a while. I also have a utility class  which
is used by XPMFileFormat and allows the use of unix rgb.txt color
strings which you are welcome to.

Simon

On Wed, 2005-11-09 at 12:08 -0500, Carolyn MacLeod wrote:
> 
> There is a bug in GIFFileFormat for writing depth 1 GIFs. 
> I have opened a bug report:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=115652 
> You can cc yourself to this bug to follow status. 
> 
> It sounds like your XBMFileFormat and XPMFileFormat classes are
> working ok. 
> Yes, your snippet below should work - it just happened that since XBM
> files are 1 bit per pixel, you stumbled into a bug writing 1-bit
> GIFs. 
> Try it with an XPM with more colours, and see what happens <grin>. 
> Are you planning to submit your 2 classes to eclipse? 
> 
> Carolyn 
> 
> 
> 
> Simon Meaden
> <simonmeaden@xxxxxxxxxxxxxxxx> 
> Sent by:
> platform-swt-dev-bounces@xxxxxxxxxxx 
> 
> 11/09/2005 04:08 AM 
>          Please respond to
>   "Eclipse Platform SWT component
>          developers list."
> 
> 
> 
> 
>                To
> platform-swt-dev@xxxxxxxxxxx 
>                cc
> 
>           Subject
> [platform-swt-dev] XBM to GIF conversion
> 
> 
> 
> 
> 
> 
> 
> 
> Hi,
> 
> I am writing (intermittantly when I have time) two addons to the 
> FileFormat class XBMFileFormat and XPMFileFormat to read X-Windows XBM
> & 
> XPM files. They both read and display fine and I am now checking that 
> they can save as well. Now they save fine in their own formats but I
> am 
> having trouble saving across formats. When I save an XBM as a GIF the 
> image is unreadable, however when I save the GIF as a different GIF
> the 
> same thing happens. I am assuming that this is possible. Here is a 
> snippet of my test code.
> 
>    protected ImageLoader loaderXBM = new ImageLoader();
>    protected ImageLoader loaderGIF = new ImageLoader();
> 
>    ImageData[] imageDataGif = 
> loaderGIF.load("/workspace/graphics/harp.gif");
>    ImageData[] imageDataXBM =
> loaderXBM.load("/workspace/test/harp.xbm");
> 
>    loaderXBM.save("/workspace/test/harp_xbm.gif", SWT.IMAGE_GIF);
>    loaderGIF.save("/workspace/test/harp_gif.gif", SWT.IMAGE_GIF);
> 
> The two images are both the same, the file harp.xbm and harp.gif
> (which 
> was converted from the xbm using gimp) and their ImageData objects
> are 
> identical except for their types.
> 
> Any suggestions would be appreciated.
> 
> Regards
> Simon Meaden
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
> 
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top