Git Product home page Git Product logo

japng's People

Contributors

aellerton avatar moko256 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

japng's Issues

NullPointerException: Attempt to read from field 'int[] net.ellerton.japng.argb8888.Argb8888Palette.argbArray' on a null object reference

https://mastodon.juggler.jp/system/custom_emojis/images/000/000/422/original/3eb47339da4d1e7a.png

D/SubwayTooter: APNGFrames: java.lang.NullPointerException: Attempt to read from field 'int[] net.ellerton.japng.argb8888.Argb8888Palette.argbArray' on a null object reference
D/SubwayTooter: APNGFrames: 	at net.ellerton.japng.argb8888.Argb8888Processors$IndexedColour8.processScanline(Argb8888Processors.java:168)
D/SubwayTooter: APNGFrames: 	at net.ellerton.japng.PngScanlineBuffer.decompress(PngScanlineBuffer.java:112)
D/SubwayTooter: APNGFrames: 	at net.ellerton.japng.argb8888.Argb8888Processor.processFrameImageData(Argb8888Processor.java:151)
D/SubwayTooter: APNGFrames: 	at net.ellerton.japng.reader.DefaultPngChunkReader.readImageDataChunk(DefaultPngChunkReader.java:175)
D/SubwayTooter: APNGFrames: 	at net.ellerton.japng.reader.DefaultPngChunkReader.readChunk(DefaultPngChunkReader.java:66)
D/SubwayTooter: APNGFrames: 	at net.ellerton.japng.reader.PngReadHelper.read(PngReadHelper.java:63)
D/SubwayTooter: APNGFrames: 	at jp.juggler.subwaytooter.util.APNGFrames.parseAPNG(APNGFrames.java:458)
D/SubwayTooter: APNGFrames: 	at jp.juggler.subwaytooter.util.CustomEmojiCache$Worker.decodeAPNG(CustomEmojiCache.java:244)
D/SubwayTooter: APNGFrames: 	at jp.juggler.subwaytooter.util.CustomEmojiCache$Worker.run(CustomEmojiCache.java:156)
D/SubwayTooter: CustomEmojiCache: PNG decode failed. https://mastodon.juggler.jp/system/custom_emojis/images/000/000/422/original/3eb47339da4d1e7a.png?1506079832 

japng

Hi Andrew

I just wanted to make you aware of my own java APNG library of the same name: https://www.reto-hoehener.ch/japng/.

It doesn't bother me too much, but it might be confusing...

Cheers
Reto

missing net.ellerton.japng.util.AsciiBitmapProcessor

I've try your test task on your master branch.
./gradlew test returns error about net.ellerton.japng.util.AsciiBitmapProcessor .
it used in

  • api\src\test\java\net\ellerton\japng\ReadMonochromeTest.java:18
  • api\src\test\java\net\ellerton\japng\ReadMonochromeTest.java:219

Large ignored chunk causes crash

When there is a large ignored chunk, it crashes in production, but not when loaded with PngInfo.java

Analysis of the cause:
The offending chunk starts decoding in DefaultPngChunkReader.readChunk(). It calls DefaultPngChunkReader.readOtherChunk() which eventually calls (via the filter input stream) BufferedInputStream.skip().

From the Javadoc of skip():

Skips over and discards n bytes of data from the input stream. The skip method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly 0. The actual number of bytes skipped is returned.

And indeed, it skips up to available() bytes, which is just under 8192 because the current pointer is still small and that's the buffer's size.

PngInfo.java doesn't wrap the input stream in a BufferedInputStream so it doesn't expose the bug.

Test image: iTXt chunk (3rd ignored chunk) of this (NSFW) image (navigate to the "Original" link in the left column!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.