Castlevania Dungeon Forums

Off Topic => Off Topic => Topic started by: TheouAegis on April 09, 2013, 02:23:55 AM

Title: Anyone know anything about PNG files?
Post by: TheouAegis on April 09, 2013, 02:23:55 AM
I redirect you to this topic on the GMC forums:
http://gmc.yoyogames.com/index.php?showtopic=577017 (http://gmc.yoyogames.com/index.php?showtopic=577017)

I ran a simple code that just changed 9 bytes of the palette in a PNG file. The file is still readable by Paintshop Pro and that little Windows Picture Viewer program. I think even web browsers can read it. However, GameMaker can't read the file AT ALL after I've run it through my palette swap code. I think this is only an issue for PNG files, but I don't know why. Anyone here have enough know-how to provide me some insight?
Title: Re: Anyone know anything about PNG files?
Post by: Lelygax on April 09, 2013, 01:35:31 PM
Try it with GIF and BMP too, so you will know for sure if this happens only in PNG.
Title: Re: Anyone know anything about PNG files?
Post by: TheouAegis on April 10, 2013, 03:29:21 AM
I can load an edited GIF file. That worked just fine, which leads me to believe that the PNG issue has to do with the CRC data in the PNG file. If my theory is correct, I would need to edit that as well in order to allow PNG files to be reloaded into Game Maker.

So can anyone here explain to me how the CRC for a PNG file is calculated exactly?
Title: Re: Anyone know anything about PNG files?
Post by: Lelygax on April 10, 2013, 05:53:12 AM
I dont know even how they calculate it in a RAR file lol
Title: Re: Anyone know anything about PNG files?
Post by: TheouAegis on April 12, 2013, 02:39:39 AM
Okay, I verified it's a CRC issue. I figured out how to find the palette in ANY PNG file (always preceded by the same code, it seems). And I found the palette's CRC. But I have no fucking clue how to translate it. So fuck it, I'm only sharing my GIF code from now on.