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

Image.fromEncodedBytes fails in Krom target #35

Open
mundusnine opened this issue Sep 22, 2019 · 1 comment
Open

Image.fromEncodedBytes fails in Krom target #35

mundusnine opened this issue Sep 22, 2019 · 1 comment

Comments

@mundusnine
Copy link
Contributor

Expected Behavior

Get image files

Current Behavior

The bytes are loaded from haxe.Resources but when trying to get the Image object from kha we get crapped data. This seems to be caused by the Js engine that recycles the data before we get it back. Hence, we get data that is null.
Here is the output:

 Trace: TypeError: Cannot read property 'width' of null
    at $hxClasses.kha.Image.get_realWidth (<anonymous>:50598:30)
    at <anonymous>:8490:36
    at Function.kha_Image.fromEncodedBytes (<anonymous>:50448:2)
    at $hxClasses.haxe.ui.ToolkitAssets.imageFromBytes (<anonymous>:8489:13)
    at $hxClasses.haxe.ui.ToolkitAssets.getImageFromHaxeResource (<anonymous>:8484:8)
    at <anonymous>:8634:14
    at $hxClasses.haxe.ui.ToolkitAssets.getImageInternal (<anonymous>:8479:4)
    at $hxClasses.haxe.ui.ToolkitAssets.getImage (<anonymous>:8628:10)
    at $hxClasses.haxe.ui.util.ImageLoader.load (<anonymous>:31113:33)
    at $hxClasses.haxe.ui.components._Image.ResourceBehaviour.validateData (<anonymous>:14510:15)
Trace: TypeError: Cannot read property 'width' of null
    at $hxClasses.kha.Image.get_realWidth (<anonymous>:50598:30)
    at <anonymous>:8490:36
    at Function.kha_Image.fromEncodedBytes (<anonymous>:50448:2)
    at $hxClasses.haxe.ui.ToolkitAssets.imageFromBytes (<anonymous>:8489:13)
    at $hxClasses.haxe.ui.ToolkitAssets.getImageFromHaxeResource (<anonymous>:8484:8)
    at <anonymous>:8634:14
    at $hxClasses.haxe.ui.ToolkitAssets.getImageInternal (<anonymous>:8479:4)
    at $hxClasses.haxe.ui.ToolkitAssets.getImage (<anonymous>:8628:10)
    at $hxClasses.haxe.ui.util.ImageLoader.load (<anonymous>:31113:33)
    at $hxClasses.haxe.ui.components._Image.ResourceBehaviour.validateData (<anonymous>:14510:15)

Possible Solution

This pull request removes the issue in the short-term. In the long-term this issue needs to be investigated in Krom.

Steps to Reproduce (for bugs)

  1. Have a dialog be visible(the X to close the window is an image so you should crash)

Context

Have a dialog open

Your Environment

This issue happens only in

  • Version used: Git haxeui-core and haxeui-kha
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Krom
  • Operating System and version (desktop or mobile): Linux and Windows
  • Issue doesn't appear: In Kore app and html5
@ianharrigan
Copy link
Member

ianharrigan commented Nov 8, 2019

Can this be closed now? Is this issue logged somewhere with Robert?

EDIT: oh yeah, i see it in Krom repo now +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants