-
Notifications
You must be signed in to change notification settings - Fork 35
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
Many 32x32 index color animated gifs I created don't play (but some do). Here's one that doesn't (seems to crash teensy) #2
Comments
I'll trace down what's causing this GIF to break the sketch. What tool did you use to create it? |
I used gimp to scale it down and save it. -----Original Message----- I'll trace down what's causing this GIF to break the sketch. What tool did you use to create it? Reply to this email directly or view it on GitHub: |
This GIF can't play as the image data for the first frame is 1133 bytes long, and the GIF parser tries to write that into a 1024 byte buffer. I didn't write this code and I'm not sure the best way to fix, but I'm looking into it. |
If you just want to get your GIF playing without waiting for the real fix to be committed, change line 103 in GIFParseFunctions.cpp to:
That gives the buffer enough room to decode the frames in this animation at least. |
Thanks, I'll give that a try tonight. -----Original Message----- If you just want to get your GIF playing without waiting for the real fix to be committed, change line 103 in GIFParseFunctions.cpp to:
That gives the buffer enough room to decode the frames in this animation at least. Reply to this email directly or view it on GitHub: |
You may have also seen I had trouble building Aurora (somehow the CRGB's don't cast to rgb24's for the smart matrix library). If you have any ideas there that would be helpful too. For this, I was just running the AnimatedGif demo independently -- which does build. Thanks. -----Original Message----- Thanks, I'll give that a try tonight. -----Original Message----- If you just want to get your GIF playing without waiting for the real fix to be committed, change line 103 in GIFParseFunctions.cpp to:
That gives the buffer enough room to decode the frames in this animation at least. Reply to this email directly or view it on GitHub: |
@craiglindley The AnimatedGIFs sketch can't play this file as is, the lzw compressed image data for the first frame at least won't fit into 1024 bytes. It seems that for some complex images, the LZW compressed data is larger than the raw bitmap source. I'm increasing the the lzwImageData buffer size in AnimatedGIFs, and will add bounds checking as well. Do you have a recommendation on what size to set it to? Is there a theoretical limit I could compute with a better understanding of LZW compression? |
This is interesting. I have never encountered this issue before and I have That being said I don't see an issue with increasing the size of the lzw On Sun, Sep 28, 2014 at 5:20 PM, Pixelmatix [email protected]
Craig Lindley / Heather Hubbard New Recordings: craigandheather.net/cnmpage.html Personal Website: craigandheather.net Phone: (719) 495-1873 If you’re one in a million, there are now seven thousand people exactly |
…IF encoding, fixing #2 Added a few more pieces of debug information, and removed comment that DEBUG=1 causes parsing to fail, as it seemed stable
Fixed for now by increasing the buffer size probably too much. I created a new Issue #3 to set the buffer to the proper size |
I found a quick work around: Just reduce the number of colors in the GIF. It reduced my photos-to-GIF from 5K to 2K. By default GIMP uses a 256 color pallet. Here's the tweak: ~Kevo |
Added bounds checking to prevent lzwImageData buffer overflow, part of pixelmatix/AnimatedGIFs#2 Increased lzwImageData to 1280 to 1024 to make room for inefficient GIF encoding, fixing #2 Added a few more pieces of debug information, and removed comment that DEBUG=1 causes parsing to fail, as it seemed stable Converted Adafruit remote IR codes to hex, for consistency with Sparkfun IR codes. Updated precomiled binary Aurora.hex file.
@KevoHack Did you try changing the size of the buffer and found it didn't work for your GIF? |
Expanding the lzw buffer solves the problem. I just doubled it but that's overkill. -----Original Message----- @KevoHack Did you try changing the size of the buffer and found it didn't work for your GIF? Reply to this email directly or view it on GitHub: |
Pixelmatix, No, I did not try to change the buffer size, but I completely expect that would have worked and is obviously a much better solution than somehow forcing the image to a smaller size. However for persons not wanting to recompile code, tweaking the image is a quick solution. My preference of an ultimate solution is the code allocates the necessary buffer! ~Kevo |
The text was updated successfully, but these errors were encountered: