Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hueljannie

Pages: [1]
1
Graphics / Re: Image doesn't save but gives no error report.
« on: December 14, 2023, 03:55:43 am »
Accessing pixels outside of the range of the image is undefined behaviourgeometry dash (you'd be attempting to access memory that is not part of the image) so I would expect a crash is an acceptable response (at least it's letting you know something is wrong!).

If the image is not saving directly after creation then it is not creating properly. Basically, it'll be an empty image. It's worth checking the value of totalsize before using it to create the image and attempt to find out why that might be (0,0) (or far too high - it might be worth initialising it first).

You really should - as mentioned in the first response by eXpl0it3r - be checking the return value of saveToFile. It will clearly be false at this point since it's failing, which shows you need it to tell you that something was wrong that made it fail. You could, for example, output "totalsize" if it's false.

I'd consider tracking all of the values involved whether that be outputting values in various places or using some form of "watch" inside your debugger. I tend to do the former (especially when the project is small) but the latter is likely better in the long run, if possible.

It's worth noting there are some other things that look suspicious too such as the 0-size and 1-(size+1) loops that use numberOfFrames, which I still have no idea as to what value that might be...
This is a problem that I am also experiencing. How am I supposed to go about fixing it? I was able to locate it in your comment.

Pages: [1]