StringStream = {
str = table.concat(output),
read = function(self, num)
num = num or 1
local toreturn = self.str:sub(1, num)
self.str = self.str:sub(num + 1)
return toreturn
end
}
Reading bytes
#21
Posted 26 July 2018 - 06:08 AM
#22
Posted 26 July 2018 - 07:20 PM
#23
Posted 27 July 2018 - 05:49 AM
printV("Deflating...")
deflate.inflate_zlib {
input = chunkData.IDAT.data,
output = function(byte)
output[#output+1] = byte --# Ditch the string.char call here
end,
disable_crc = true
}
local callCount = 1
StringStream = {
read = function(self, num)
num = num or 1
local start, fin = callCount, callCount + (num or 1) - 1
callCount = callCount + num
return unpack(output, start, fin)
end
}
This is why you're not seeing a "filter type" in that error message, as the filterType variable either currently holds a value that can't be rendered as a character (not so much of a problem, but less likely), or it's just an empty string (very much a problem, and unfortunately more likely).
If you find the latter to be true (and the error starts telling you the filter type is nil), that'd imply that the deflate.inflate_zlib() call on line 392 isn't actually putting any data into the "output" table. In that case, first check that the table parameters used in the inflate call are formatted correctly, and then check whether chunkData.IDAT.data actually holds some data.
Edited by Bomb Bloke, 27 July 2018 - 06:29 AM.
#24
Posted 28 July 2018 - 08:13 PM
#25
Posted 29 July 2018 - 03:01 AM
#26
Posted 31 July 2018 - 09:19 PM
#27
Posted 01 August 2018 - 03:38 AM
#28
Posted 02 August 2018 - 02:41 PM
#29
Posted 03 August 2018 - 02:51 AM
By the way, digging a bit further I notice you're omitting DelusionalLogic's copyright notice. Be sure to include it in all copies of your code that include this work.
#30
Posted 03 August 2018 - 05:53 PM
Anyway, this is the code I am running as I uploaded it to pastebin via the in game pastebin script. So what else could this be?
#31
Posted 04 August 2018 - 01:01 AM
#32
Posted 04 August 2018 - 05:17 PM
https://ibb.co/mosXVe
#33
Posted 08 August 2018 - 02:35 PM
#34
Posted 08 August 2018 - 07:11 PM
emanuel12324, on 08 August 2018 - 02:35 PM, said:
line 332:
local filterType = readByte(stream)
Line 332 will not cause that error as bomb bloke said. Make sure line 332 is that line in the program you tried to run as well. If it is not then post your code to pastebin again give us the link here.
Edited by valithor, 08 August 2018 - 07:12 PM.
#35
Posted 08 August 2018 - 08:05 PM
#36
Posted 08 August 2018 - 08:43 PM
emanuel12324, on 08 August 2018 - 08:05 PM, said:
If that was the case, trace would show it to you.
Edit: Just checked myself, in line 332 you are calling readByte(), which calls stream.read(stream).
However stream.read requires 2 Arguments, the stream and the number of bytes to read, the second one is not passed to it.
Edit 2: Also BB already told you about that error, which further makes me believe, that you are not providing us your current code.
Edited by Luca_S, 08 August 2018 - 08:59 PM.
#37
Posted 09 August 2018 - 03:13 AM
#38
Posted 09 August 2018 - 04:39 AM
Luca_S, on 08 August 2018 - 08:43 PM, said:
If that were the case, the error would directly point to line 171, where StringStream:read() is called: there wouldn't be any need to use trace to get that info. We're only interested in what's at the top of the stack, not what's lower down.
Luca_S, on 08 August 2018 - 08:43 PM, said:
It's been changed so that the second argument is optional. Even if it hadn't, though, that still wouldn't trigger the stated error on the stated line.
emanuel12324, on 09 August 2018 - 03:13 AM, said:
This is another strong indication that you're not running the script file you think you're running.
How are you uploading the code to pastebin - with the "pastebin put" command, or by manually copying the file out of the computer's folder within your world save?
In the latter case, I'd say there's a good chance you're looking at the wrong computer folder!
#39
Posted 09 August 2018 - 05:08 AM
Bomb Bloke, on 09 August 2018 - 04:39 AM, said:
Edited by SquidDev, 09 August 2018 - 05:09 AM.
#40
Posted 09 August 2018 - 06:38 AM
As for why it's erroring at all, it occurred to me that, in the unlikely event that emanuel is running the posted code, the error may be coming from another file. For example, if deflatelua is rigged to run a second copy of imgtest buried in a subfolder, then that could crash before the primary copy does.
Of course, that would be a very difficult mistake to make accidentally!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











