Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

AppGameKit for Python

Create games using AppGameKit and Python! · By Fascimania

RuntimeWarning: Image raw:grass.png is too large, resizing to 0x0

A topic by oguh43 created Jan 21, 2021 Views: 291 Replies: 10
Viewing posts 1 to 7

Hi, this is the result every time when i try to load an image. Full path doesn't work either. Python 3.9.1 64-bit

Developer (1 edit)

Thanks for reporting this.  I'll look into it.

What OS?

Hi, my operating system is Windows 64 bit. If i remember correctly, i have spaces and "weird" characters in my path, e.g. "áäčý"

Developer

Thanks for the info.  That's probably the cause.  So I'll need to research how to get it to work with non-ASCII paths.

Developer (1 edit)

By the way, what are the actual dimensions of grass.png?

hi, everything is 40x40 and fails to load

Developer (1 edit)

OK.  I fixed a couple of places where utf-8 strings weren't handled correctly.  I got different errors than you did, but hopefully this also fixes yours.

Would you download and try this file: (file removed) ?  It should go in the "appgamekit\_x64" folder.

Well, it still doesnt work, `agk.load_image("grass.png")` produces `RuntimeWarning: Could not find image: raw:grass.png"grass": agk.load_image("grass.png")`

This: `agk.load_image(os.path.join(media_folder,"right_path.png"))` where `media_folder` = `

__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
media_folder = os.path.join(__location__,"media")

`

results in `RuntimeWarning: Image raw:C:/Users/agent/OneDrive/Documents/github/net/agk/media/right_path.png is too large, resizing to 0x0`

Developer (1 edit)

Are either of those PNG files available online somewhere?  If not, would you mind emailing me one so that I can test with it?

(1 edit)

sent :) (from agenthugo43@gmail.com)

btw: those are placeholders because I'm too lazy to make proper textures :)

Developer

Glad we got this figured out.

Resolution: load_image (and almost all of the commands) must be used while an Application object has been created.