Bug 242426 - ImageLoader returning image data with incorrect byte order
Summary: ImageLoader returning image data with incorrect byte order
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Kevin Barnes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-29 13:12 EDT by Kevin Barnes CLA
Modified: 2019-09-06 16:13 EDT (History)
2 users (show)

See Also:


Attachments
bitmap (10.67 KB, image/bmp)
2008-07-29 13:13 EDT, Kevin Barnes CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Barnes CLA 2008-07-29 13:12:16 EDT
When loading the attached (32 bit bmp) image, we're expecting it to have most significant byte first MSB_FIRST, but getting LSB_FIRST. Eventually when the image gets created it's yellow.


    public static void main(String[] args) {
        final Display display = new Display();
        final Shell shell = new Shell(display);
        shell.setText("Canvas Example");
        shell.setLayout(new FillLayout());
        Canvas canvas = new Canvas(shell, SWT.NONE);
        canvas.addPaintListener(new PaintListener() {
            public void paintControl(PaintEvent e) {
                try {
                	ImageLoader loader = new ImageLoader();
                	ImageData[] loaded = loader.load("close.bmp");
                    Image image = new Image(display, loaded[0]);
                    e.gc.drawImage(image, 10, 10);
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        });

        shell.open();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
        display.dispose();
    }
Comment 1 Kevin Barnes CLA 2008-07-29 13:13:15 EDT
Created attachment 108671 [details]
bitmap
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:13:38 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.