Where I load the first 4 bytes (that’s the little blocks of numbers on the left), and check if I can read them as text, and whether the text spells out “ASEF”, if not, I have to break off loading, because the file is incorrect.ĭevelopers are usually a bit hesitant to support binary file formats that haven’t got a proper standard or documentation (for example, most image formats are binary, but PNG and JPEG have standards documents that has been assembled and reviewed by a ton of programmers and has example code), because it can take a ton of work to get the data out, saving is even scarier: If you make a mistake with the order of the bytes, you end up with a corrupted file that cannot be reopened anymore. For ASE for example, my code would look something like this: QBuffer buf(&data) Here’s some very clear examples of reversed-engineered palette formats. Maybe the numbers are stored in percentages, or maybe the size is actually in ‘radius’ instead of ‘diameter’, so that too needs a ton of test files. This is probably what the artstudio pro developers did.įurthermore, after figuring out which value is what, you also need to figure out how exactly all the little numbers create a brush preset. For example, all PSD blocks end with 8BIM (which is either 34 42 49 4D or 4D 49 42 34 depending on the computer it was saved with), so maybe something like ABR has the same thing going on. This involves comparing a whole lot of files, and then sorta seeing where they differ and trying to guess from the patterns whether you are looking at a color, or a curve or a toggle. With an undocumented binary format, like ABR, it gets even harder, because you then need to reverse engineer it. When we program in support for a feature in a binary format like PSD, we need to look at the existing documentation to start with, then we also need a whole bunch of test files to check against, because the PSD documentation is filled with flaws and errors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |