Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Work on APNG Encode Support #1

Merged
merged 67 commits into from Nov 22, 2020
Merged

Work on APNG Encode Support #1

merged 67 commits into from Nov 22, 2020

Conversation

Rimpampa
Copy link

@Rimpampa Rimpampa commented Nov 11, 2020

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.

Osspial and others added 30 commits November 24, 2019 00:35
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.
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.
…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.
Ivo van der Lans and others added 26 commits August 16, 2020 14:34
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).
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.
Expose semantic result types for next_{interlaced_,}row
Remove incorrect notice in Transformations documentation
@rrbutani rrbutani merged commit fc05a58 into rrbutani:apng Nov 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet