Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing Picture using IE 9-10 does not work #66

Open
mani76 opened this issue Apr 3, 2015 · 15 comments
Open

Showing Picture using IE 9-10 does not work #66

mani76 opened this issue Apr 3, 2015 · 15 comments
Assignees
Labels
Milestone

Comments

@mani76
Copy link

mani76 commented Apr 3, 2015

Hello,

I am not able to show jpg image in LienzoPanel when using IE 9 or 10.
When adding following CanvasPanel to the RootLayout it should show test.jpg, but with IE it shows error message in the console: SCRIPT5022: IndexSizeError

It works ok with Safari and Chrome.

public class CanvasPanel extends LienzoPanel {

    private Layer layer;

    public CanvasPanel() {
        super(500, 500);
        layer = new Layer();

        add(layer);
        String url = "test.jpg";
        Picture picture = new Picture(url, false).onLoaded(new PictureLoadedHandler() {
            @Override
            public void onPictureLoaded(Picture picture) {
                layer.draw();
            }
        });

        layer.add(picture);
    }
}
@SprocketNYC
Copy link
Contributor

Which version of Lienzo?

Dev mode or compiled mode?

I'll need to look for an IE9/10 machine, I don't have access to one at the moment.

@mani76
Copy link
Author

mani76 commented Apr 5, 2015

Latest development version using super dev mode and also deployed application

@SprocketNYC
Copy link
Contributor

ugh, can not reproduce error. I don't have ANY dev box with IE9/10, IE11 is working fine. ANY more info would help, console error logs, SDM console log, Old dev mode stack, ANYTHING. Also exact GWT version, Lienzo version, etc.... how big is test.jpg? can you try layer.add(picture) in the handler?

Need some help.

@mani76
Copy link
Author

mani76 commented Apr 8, 2015

Hello,

It seems to be that minimum code line needed is to just create a new Picture:

Picture p = new Picture(url, false);

if url points to the correct image url exception is thrown, if image is not found constructor works ok.

GWT version is 2.7

Here is DEV mode trace:

17:17:30.403 [ERROR] [lienzotester] Uncaught exception escaped

com.google.gwt.event.shared.UmbrellaException: Exception caught: (IndexSizeError) @com.ait.lienzo.client.core.NativeContext2D::drawImage(Lcom/google/gwt/dom/client/Element;DDDDDDDD)([JavaScript object(107), double: 0.0, double: 0.0, double: 0.0, double: 0.0, double: 0.0, double: 0.0, double: 0.0, double: 0.0]): IndexSizeError
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:125)
at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
at com.google.gwt.user.client.ui.Image.onBrowserEvent(Image.java:816)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1480)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1419)
at com.google.gwt.user.client.impl.DOMImplStandard.dispatchEvent(DOMImplStandard.java:317)
at com.google.gwt.user.client.impl.DOMImplStandard.dispatchUnhandledEvent(DOMImplStandard.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:341)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:222)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:299)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:296)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:551)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.google.gwt.core.client.JavaScriptException: (IndexSizeError) @com.ait.lienzo.client.core.NativeContext2D::drawImage(Lcom/google/gwt/dom/client/Element;DDDDDDDD)([JavaScript object(107), double: 0.0, double: 0.0, double: 0.0, double: 0.0, double: 0.0, double: 0.0, double: 0.0, double: 0.0]): IndexSizeError
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:252)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:315)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.ait.lienzo.client.core.NativeContext2D$.drawImage$(NativeContext2D.java)
at com.ait.lienzo.client.core.Context2D.drawImage(Context2D.java:382)
at com.ait.lienzo.client.core.image.ImageProxy.doInitialize(ImageProxy.java:388)
at com.ait.lienzo.client.core.image.ImageProxy.access$8(ImageProxy.java:350)
at com.ait.lienzo.client.core.image.ImageProxy$1.onLoad(ImageProxy.java:307)
at com.ait.lienzo.client.core.image.ImageLoader$1.onLoad(ImageLoader.java:61)
at com.google.gwt.event.dom.client.LoadEvent.dispatch(LoadEvent.java:56)
at com.google.gwt.event.dom.client.LoadEvent.dispatch(LoadEvent.java:1)
at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:125)
at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
at com.google.gwt.user.client.ui.Image.onBrowserEvent(Image.java:816)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1480)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1419)
at com.google.gwt.user.client.impl.DOMImplStandard.dispatchEvent(DOMImplStandard.java:317)
at com.google.gwt.user.client.impl.DOMImplStandard.dispatchUnhandledEvent(DOMImplStandard.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:341)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:222)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:299)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:296)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:551)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
at java.lang.Thread.run(Thread.java:744)

@SprocketNYC SprocketNYC added this to the 2.0 milestone Jun 14, 2015
@SprocketNYC SprocketNYC self-assigned this Jun 14, 2015
@jmgabriel
Copy link

I confirm the bug on my side also (GWT 2.6.1)

@SprocketNYC
Copy link
Contributor

Ahh, from the exception I see the image size is 0.0 for everything. I'll take a look.

@SprocketNYC
Copy link
Contributor

OK, I rolled IE 11 back to 10 on a VM, can reproduce, which is half the battle...

@SprocketNYC
Copy link
Contributor

Try 2.0.151-RC1

@helmutprovost
Copy link

Hi Dean,

After updating to 2.0.231-RC1, the same problem exists on IE9 (WIN7).
0471cb9e-cffa-11e5-84e0-371eaf941fde
04857446-cffa-11e5-8ac5-fafdaa8bbeca

I am unable to view the real stacktrace, but it matches the same stacktrace given by mani76, on Apr 8, 2015

@helmutprovost
Copy link

Additional information:
This fails on IE9 (WIN7) but works fine on

I use a 256x256 PNG image resource.
The source code looks like this:
Predefined variables:
LienzoPanel lienzoPanel, ImageResource imageResource, int x, int y, int width, int height

Group group = new Group();
Layer layer = new Layer();
lienzoPanel.add(layer);
layer.add(group);
new Picture(imageResource, false).onLoaded(new PictureLoadedHandler() {

    @Override
    public void onPictureLoaded(final Picture picture) {
        picture.setLocation(new Point2D(x, y));
        picture.setClippedImageDestinationHeight(height);
        picture.setClippedImageDestinationWidth(width);
        group.add(img);
        lienzoPanel.draw();
    }
});

@SprocketNYC
Copy link
Contributor

Gimme a bit to try to dig up an old VM image of Windows with IE9. It's a long shot... and will take quite a while to get everything set up. If you want to submit a PR, go ahead, I'll test it, and if it's fine, I'll merge.

Its the open source way :-)

@helmutprovost
Copy link

Dean, when I setup such an environment, I go to https://dev.windows.com/en-us/microsoft-edge/tools/vms/linux/ and there I select the Windows Image I want to test in my vm.
Maybe this can come in very handy for testing these images.

@SprocketNYC
Copy link
Contributor

Oooooh, THAT IS COOL. Thanks, I'll give it a try tonight.

@helmutprovost
Copy link

Read https://www.maketecheasier.com/import-export-ova-files-in-virtualbox/ if you're not used to install this.

@SprocketNYC SprocketNYC reopened this Feb 15, 2016
@SprocketNYC
Copy link
Contributor

I have both VirtualBox and VMWare Fusion on Mac... one will work.

@SprocketNYC SprocketNYC modified the milestones: 2.1, 2.0 May 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants