[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] 'Unsupported color depth' error on Linux


Hi Rajeev,

Unlike GIF, the BMP encoder should support all the bit depths.

Chris




Rajeev Sikka <sikkar@xxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

07/29/2004 01:42 PM

Please respond to
platform-swt-dev

To
platform-swt-dev@xxxxxxxxxxx
cc
Subject
[platform-swt-dev] 'Unsupported color depth' error on Linux






Hi,


I have the following code sequence:


...

Image image = ...

...

ImageData imageData = image.getImageData();

...

ImageLoader imageLoader = new ImageLoader();

imageLoader.save(..., SWT.IMAGE_GIF);

...


This runs fine on windows but gives 'Unsupported color depth' error on Linux. The reason is that the code for Image::getImageData() is different for Windows and Linux. On Linux the returned ImageData object has color depth 24 (on windows its 8). Here is the code snippet from Image.java on Linux:


ImageData data = "" ImageData(width, height, 24, palette);


Subsequently, the function ImageLoader::save which indirectly calls unloadIntoByteStream(ImageData ) in file GIFFileFormat.java throws a SWT.error, since valid color depths are only 1, 4, and 8.


Is there any workaround/alternative way to get around this?


Thanks,

Rajeev