Can't load any file as imageData

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
deiwyy
Prole
Posts: 1
Joined: Sun Nov 29, 2020 5:51 pm

Can't load any file as imageData

Post by deiwyy » Sun Nov 29, 2020 6:20 pm

I get an error whenever i try to do

Code: Select all

love.graphics.newImage("icon.png")
or

Code: Select all

love.image.newImageData("icon.png")
I've tried using png, jpg and ico file formats, all of them gave me this error

Error

boot.lua:557: Could not decode file 'icon.jpg' to ImageData: unsupported file format


Traceback

[C]: in function 'newImageData'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

All of the images were valid (I had no problem opening them in galery)

User avatar
ReFreezed
Party member
Posts: 204
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Can't load any file as imageData

Post by ReFreezed » Sun Nov 29, 2020 9:47 pm

I don't think JPEG files are supported any longer. ICO files were never supported, afaik. PNG files should work though. Not sure what the problem is. Can you upload one of the PNG files that don't work?
Tools: Hot Particles, LuaPreprocess, (more)
Games: Momento Temporis: Light from the Deep, Energize!
"If each mistake being made is a new one, then progress is being made."

User avatar
pgimeno
Party member
Posts: 2414
Joined: Sun Oct 18, 2015 2:58 pm

Re: Can't load any file as imageData

Post by pgimeno » Sun Nov 29, 2020 11:54 pm

JPEG writing isn't supported, but JPEG reading is. love.graphics.newImage('image.jpg') is working fine for me as well as love.image.newImageData('image.jpg').

+1 about showing a problematic file. Unfortunately, I think that during the first few posts, people can't attach stuff.

Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests