New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pixly #1177
Pixly #1177
Conversation
Hi @zed9h, could this use the same png encoder/decoder to avoid duplicating the whole code? I see that it opens an XML file and a png file, so to load the png file you might try to use the png decoder (or calling Also could you please sign our CLA? |
@dacap, maybe It would be cleaner if I create a helper to decode/encode the PNG for both file formats, but first I will work on the Pixly format save, which will add more value upfront. PS: I will read the CLA. |
I'll take a look at this on next Tuesday. At the moment I recommend you to use You can use |
I signed the CLA and finished the Pixly file save; the code ended up much simpler than the original PNG format, because it only handle RGBA, take a look if you think it worth the generalization of the codec. For me it was easier to handle a standard lib code than aseprite internal structure, even when I found the latter pretty clear and organized. |
@zed9h Remember that there is an email required in the CLA signing process too. |
"<PixlyAnimation version=\"1.5\">\n" | ||
"\t<Info " | ||
"sheetWidth=\"%d\" sheetHeight=\"%d\" " | ||
"totalCollumns=\"%d\" totalRows=\"%d\" " |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
As a side note, I'll need several |
@dacap Great points, I placed many more check()s and improved the error messages. I will send some good files and some bad ones to test the exceptions. |
{ | ||
const Sprite* sprite = fop->document()->sprite(); | ||
|
||
if(sprite->pixelFormat() != IMAGE_RGB || !fop->document()->sprite()->needAlpha()) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
If I remove the FILE_SUPPORT_PALETTE_WITH_ALPHA and the auto-generated palette has some alpha on it, there will be a warning every time the file is saved, so I think I will need to keep this flag, even if the palette will not be saved. I also added FILE_SUPPORT_BIG_PALETTES for the same reason. (Not really sure if this is the right way to go.) I cleaned up some includes that seemed unnecessary. |
Mhh, I think it's a bug in the code that check conditions in The You can leave the flags and I'll then modify when the fix is done. Don't worry about that. |
int imageCount = check_number<int>(xmlFrames->Attribute("length")); | ||
|
||
if(layerCount <= 0 || imageCount <= 0) { | ||
throw Exception("No cels found"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Finally I got a crash saving this file: Could you please check this issue? |
As I suspected when I saw the line of the error, the cel image can be smaller than the sprite size, I will compensate for that. |
Returning to this one: I'll finally remove |
Of course, if the palette is user created there should be a warning. @dacap BTW, I didn't explain it properly here, the "collums" (sic) are on the official Pixly format, nothing I could do about it. |
👍 yeah, that's what I thought |
First try at implementing the Pixly file format, just loading for now and I tested with only two files, but it could be useful to some people (for instance this guy), so I am pushing right away.