Error adding images

52 views
Skip to first unread message

Yuandong Li

unread,
Nov 17, 2016, 2:50:45 AM11/17/16
to Game Closure DevKit
Hello. I installed the latest GC devkit and created a new project following the instructions on the official website. The hello world example runs without a problem.
However, when I put an image into the resources/images folder and try to run the simulator again, it gives me an error:
 [error]
⤷  Error (native)
Error: EINVAL: invalid argument, utime 'C:\Users\me\Documents\MY_GAME\build\debug\simulator\resources\images\my_img.jpg'
                    Unexpected error in stream write-files
           [build]  [error]  Error: error in write-files stream
                    build failed

I did touch anything else other than throwing an image into the resources/images folder and tried it on several computers only getting the same error.
By the way, I am using Windows.

Do anyone have a solution? Thanks!

Jimmy Griffith

unread,
Nov 17, 2016, 3:37:46 AM11/17/16
to Yuandong Li, Game Closure DevKit
Hey Yuandong,

I believe we only support PNG format for images. We have an automatic spriter that creates spritesheets for cross-platform builds. Those spritesheets can be set to JPEG format via a metadata.json, if for example, you want to optimize some images that don't have any transparency in your final builds.

Try converting to a PNG, does that work?

Cheers!
Jimmy
--
    
    
/**
 * Jimmy Griffith
 * Studio Head | Blackstorm Labs
 *
 * ji...@blackstormlabs.com
 * +1-704-309-2473
 */

Yuandong Li

unread,
Nov 17, 2016, 3:47:16 AM11/17/16
to Game Closure DevKit, yuan1...@gmail.com
Hi Jimmy,

Thanks for the quick response. I tried png as well but same error again.

Jimmy Griffith

unread,
Nov 17, 2016, 3:51:29 AM11/17/16
to Yuandong Li, Game Closure DevKit

Yuandong Li

unread,
Nov 17, 2016, 4:08:22 AM11/17/16
to Game Closure DevKit, yuan1...@gmail.com
I tried the suggestions in those threads like using pngs with 8-bit channels but still it doesn't work.
One thing I noticed is that although such error is thrown when executing it in the simulator, it can display the image without any problems if I build it for desktop browser, upload it to a server and then access it via the browser.

Yuandong Li

unread,
Nov 17, 2016, 6:49:35 AM11/17/16
to Game Closure DevKit, yuan1...@gmail.com
Upon searching for the error message, I came across a post mentioning NodeJs' fs.utimes would throw this error when the timestamps passed are not instances of Date.
What's more, it only throws on Windows but not Ubuntu. Would it be the case here? Maybe some code producing the simulator build pass non-Date instances as arguments to fs.utime function?

Reply all
Reply to author
Forward
0 new messages