[Patchanim-commit] SF.net SVN: patchanim: [136] trunk/patchanim/src/com/mebigfatguy/apng/ APngEncod
Brought to you by:
dbrosius
From: <dbr...@us...> - 2008-02-10 05:56:01
|
Revision: 136 http://patchanim.svn.sourceforge.net/patchanim/?rev=136&view=rev Author: dbrosius Date: 2008-02-09 21:56:06 -0800 (Sat, 09 Feb 2008) Log Message: ----------- get sequence number right should incr on every fcTL and fdAT Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java Modified: trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 05:46:03 UTC (rev 135) +++ trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 05:56:06 UTC (rev 136) @@ -95,6 +95,9 @@ if (!started) return false; try { + Chunk iendChunk = new Chunk(0, IEND); + iendChunk.calcCRC(); + iendChunk.write(out); if (closeStream) out.close(); } catch (IOException ioe) { @@ -137,7 +140,7 @@ case IDAT: if (!sawIDAT) { Chunk fcTLChunk = new Chunk(26, fcTL); - fcTLChunk.injectInt(0, seqNum); + fcTLChunk.injectInt(0, seqNum++); fcTLChunk.injectInt(4, im.getWidth()); fcTLChunk.injectInt(8, im.getHeight()); fcTLChunk.injectInt(12, 0); @@ -153,22 +156,16 @@ chunk.write(out); } else { Chunk fdATChunk = new Chunk(chunk.length + 4, fdAT); - fdATChunk.injectInt(0, seqNum); + fdATChunk.injectInt(0, seqNum++); System.arraycopy(chunk.data, 0, fdATChunk.data, 4, chunk.length); fdATChunk.calcCRC(); fdATChunk.write(out); } break; - - case IEND: - if (seqNum >= (frameCount - 1)) - chunk.write(out); - break; } chunk = pStrm.readNextChunk(pStrm); } processedFirstFrame = true; - seqNum++; return true; } catch (IOException ioe) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |