aellerton / japng Goto Github PK
View Code? Open in Web Editor NEWFlexible Java-only PNG reader with APNG and Android support.
License: Other
Flexible Java-only PNG reader with APNG and Android support.
License: Other
https://www.dropbox.com/s/o30vium13e3buxc/ct10e.png?dl=0
this image is not transparent, but it was decoded to transparent black in BasicArgb8888Director#receiveDefaultImage().
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
https://mastodon.juggler.jp/system/custom_emojis/images/000/000/021/original/tama2.png
PngFeatureException Interlaced images are not yet supported
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
I've try your test task on your master branch.
./gradlew test
returns error about net.ellerton.japng.util.AsciiBitmapProcessor .
it used in
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!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.