question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GWT not possible to download images into pixmap

See original GitHub issue

Issue details

When compiling WEB with gradlew.bat html:dist getting an exception:

The constructor Pixmap(byte[], int, int) is undefined

How can I load an image from a URL on WEB/GWT/HTML5? Also, there is a warning there, is it safe to ignore?

Reproduction steps/code

OS: Windows 10 IDE: Intellij Executing command: gradlew.bat html:dist

Version of LibGDX and/or relevant dependencies

Please provide the version(s) affected.

Stacktrace

Compiling error

> Task :html:compileGwt
Apr 27, 2020 7:54:12 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Compiling module com.gazman.stories.GdxDefinition
   Tracing compile failure path for type 'my.file.java'
      [ERROR] Errors in 'file:/C:/my.file.java'
         [ERROR] Line 62: The constructor Pixmap(byte[], int, int) is undefined
   [ERROR] Aborting compile due to errors in some input files

Java source code:

    byte[] bytes = ...
    Pixmap pixmap = new Pixmap(bytes, 0, bytes.length);

Please select the affected platforms

  • Android
  • iOS (robovm)
  • iOS (MOE)
  • [ *] HTML/GWT
  • [ *] Windows
  • Linux
  • MacOS

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Darkyenuscommented, Apr 28, 2020

@IlyaGazman For info on pull requests, see this (or any other) general info tutorial and this libGDX specific page for contributors. You don’t have to get it right the first time - that is what code review is for, so don’t worry about it too much.

@shatterblast: By warning, I meant this line:
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5., which has nothing to do with any networking and everything to do with windows registry.

2reactions
shatterblastcommented, Apr 27, 2020

The standard way includes using an InputStream with some REST protocols. The Google HTTP Client can help some. You might check StackOverflow for some references.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where to place images in gwt? - java - Stack Overflow
I'm trying to load a simple image in GWT. But it is never found. import com.google.gwt.user.client.ui.Image; public ...
Read more >
[GWT] Documentation - Image Bundles
GWT can package many image files into a single large file to be downloaded from the server and managed as a Java object....
Read more >
read images from filesystem - SmartClient Forums
Good afternoon. I have a big doubt with the APIs of SmartGwt. It exists some way to get a lot of image files,...
Read more >
Generate URL to image stored on server - Google Groups
1. User uploads image. This is stored and the URL returned. An image widget is constructed around this URL. This part is functional...
Read more >
Google Web Toolkit - ImageBundle - NTNU
An image bundle is a composition of multiple images into a single large image, ... ImageBundle { /** * Notice that the gwt.resource...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found