This repository has been archived by the owner on Feb 12, 2021. It is now read-only.
forked from image-rs/image-png
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, it claimed that only IDENTITY and TRANSFORM_EXPAND | TRANSFORM_STRIP_ALPHA worked, but this is no longer true.
Note that the color type must be manually set to 'indexed'.
Since `Write` is automatically implemented for `&'_ mut impl Write`.
Add support for encoding with fixed palette
Add meta data and changes for release 0.16.5
- Dropped large files slowing down fuzzing but not providing much coverage; speeds up fuzzing 100x - Run cargo-fuzz in release mode for 2 million iterations; coverage increased from 1434 to 1557 edges - Moved fuzzing seeds from AFL folder to cargo-fuzz corpus folder, since cargo-fuzz has a default location for seeds while AFL does not
Fix fuzzing harness + refresh fuzzing corpus for 0.16.5 (miniz_oxide backend)
The calculation for buffer size used a different path than the color used during actual decoding, especially when the flags would expand colors. This would only panic during the decoding of interlaced images. For standard images the remaining data would simply get dropped.
This is no longer really necessary since color types would be treated somewhat correctly. However, let's restrict ourselves to the standardized color types for now.
Fix decoding invalid color combinations
Turn bpp into a proper enumeration
Fixes an issue affecting mainly platforms with 32-bit (or smaller) pointer size where the calculation of required buffer sizes would use unchecked math ops that could silently overflow. We now try to calculate the maximum of the necessary lengths up-front, as part of converting to a Reader, which ensures that all other computations have no overflow.
Check buffer sizes for overflow
…pty-hdr Add an explicit fail test for IHDR with 0x0 image
This now checks the buffer sizes immediately after decoding the header chunk. Additionally we try to calculate the linelen of a raw row of data which might be larger than the output size when the original bit depth is 16 and a transformation truncating to 8-bit is active.
Fix int overflow from delayed size check
Refresh fuzzing corpus again following the fix of image-rs#222
As documented, the info applies to the previously read frame. In case one wants to read multiple frames it will be beneficial if the info can be preserved. This can already be done by hand as the struct only has public members.
Improves code-comments; Standardizes code formatting;
Removes PartialOrd, Ord, Hash auto-implemented traits from SourceChromaticities; Adds test against PngSuite;
Adds reading and writing of gAMA (gamma) and cHRM (primary chromaticities).
Update to miniz_oxide 0.4
Forbid unsafe code
In particular this gives us the opportunity to adjust its Debug impl and potentially add a Display adaptor in the future, or some amount of inherent methods and impls.
These took a small Copy-Type by value.
…ples Issue 213 color samples
Turn ChunkType into a type
Expose semantic result types for next_{interlaced_,}row
Remove incorrect notice in Transformations documentation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I continued working from where @rrbutani left issue #93 by sorting out merge conflicts and by making it work, kind of:
I know the current solution it's not the perfect one and I can work on this to make it better, but before doing anything I'd like to hear your opinions about it.
I think that it would be better to create another type of writer/writer+encoder for animations.
Currently it just uses the same function (
write_image_data
) for both animations and single images, and checks whether animation related options are set to understand which one of them it is.