Why can't I open an image?
Posted: Mon Feb 25, 2013 9:53 pm
Hello.
Sorry if this question has been asked, but I've searched the forum and found nothing.
I just got started working in LOVE today. I am working on a testing application, and I needed a simple GUI interface. LOVE seemed to fit the bill. I would rather not share my .love file, as it has some confidential information already in it. However, I would be willing to make a "sanitized" version if whatever my problem is is not immediately apparent.
So anyway, I cannot open images. On my desktop, I have a folder for my program that contains the following files/folders:
autoTest.love
love.exe
DevIL.dll
OpenAL32.dll
SDL.dll
autoTest.bat (a batch file that contains this text: START love.exe autoTest.love)
AND the following folders:
Scripts
resources
Scripts contains various other Lua scripts I want to leave in Lua, not be zipped up.
The resources folder contains images for my GUI.
However, I cannot load any images at all. first, I tried using this script to load images:
scriptsInstalled = love.graphics.newImage('./resources/scripts_installed.jpg')
I get an error: "Could not open file ./resources/scripts_installed.jpg. Does not exist."
So I changed it to this:
scriptsInstalled = love.graphics.newImage(love.filesystem.getWorkingDirectory() .. '/resources/scripts_installed.jpg')
I get the same error, but now it gives me the full path on my C:\ drive.
So then I tried to just open the file
local f = love.filesystem.newFile(love.filesystem.getWorkingDirectory() .. '/resources/scripts_installed.jpg')
Same problem.
I even tried moving the image to the same directory as the .love file and love.exe. Same problem.
No matter what I do, I can't get it to open an image file. And yes, the file name is correct.
Can anyone help me with this limited description, or do I need to make a sanitized version of my LOVE application so that you guys can see the problem yourselves?
Sorry if this question has been asked, but I've searched the forum and found nothing.
I just got started working in LOVE today. I am working on a testing application, and I needed a simple GUI interface. LOVE seemed to fit the bill. I would rather not share my .love file, as it has some confidential information already in it. However, I would be willing to make a "sanitized" version if whatever my problem is is not immediately apparent.
So anyway, I cannot open images. On my desktop, I have a folder for my program that contains the following files/folders:
autoTest.love
love.exe
DevIL.dll
OpenAL32.dll
SDL.dll
autoTest.bat (a batch file that contains this text: START love.exe autoTest.love)
AND the following folders:
Scripts
resources
Scripts contains various other Lua scripts I want to leave in Lua, not be zipped up.
The resources folder contains images for my GUI.
However, I cannot load any images at all. first, I tried using this script to load images:
scriptsInstalled = love.graphics.newImage('./resources/scripts_installed.jpg')
I get an error: "Could not open file ./resources/scripts_installed.jpg. Does not exist."
So I changed it to this:
scriptsInstalled = love.graphics.newImage(love.filesystem.getWorkingDirectory() .. '/resources/scripts_installed.jpg')
I get the same error, but now it gives me the full path on my C:\ drive.
So then I tried to just open the file
local f = love.filesystem.newFile(love.filesystem.getWorkingDirectory() .. '/resources/scripts_installed.jpg')
Same problem.
I even tried moving the image to the same directory as the .love file and love.exe. Same problem.
No matter what I do, I can't get it to open an image file. And yes, the file name is correct.
Can anyone help me with this limited description, or do I need to make a sanitized version of my LOVE application so that you guys can see the problem yourselves?