Imdecode function returns empty array

okay.

not okay. that is silly. compression doesn’t work like that. with these antics you’ll end up with even more bytes. don’t do any of this.

debug your code. that means take it apart. all that UDP and network stuff is separate from the imencode/imdecode stuff. don’t make all of it work at once. take one aspect, verify that it works completely. don’t just look at code and variables, make the program check itself.

related question:

https://stackoverflow.com/questions/72138217/imdecode-function-returns-none