[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[platform-swt-dev] Tiff Image Loading in 3.6 M6
|
There seems to be some problems with the tif image loading. I have two examples where one loads it as a black image and another
gives an error when loading.
Dave Smith
Candata Ltd.
416-493-9020x2413
Direct: 416-855-2413
import java.io.FileOutputStream;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
public class TiffTest
{
public static void main(String[] args) throws Exception
{
new TiffTest().loadImages();
}
public void loadImages() throws Exception
{
ImageLoader imageLoader = new ImageLoader();
// all black image
ImageData[] image1 = imageLoader.load("/tmp/image1.tif");
FileOutputStream fileOutputStream = new FileOutputStream("/tmp/image1out.tif");
imageLoader.save(fileOutputStream, SWT.IMAGE_TIFF);
fileOutputStream.close();
// won't load at all
ImageData[] image2 = imageLoader.load("/tmp/image2.tif");
}
}
Attachment:
image1.tif
Description: TIFF image
Attachment:
image2.tif
Description: TIFF image