Merge branch 'master' into Anhil-111-patch-1

This commit is contained in:
Josh Holmer 2020-11-06 18:04:05 -05:00 committed by GitHub
commit 93a41cb3e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 352 additions and 335 deletions

View file

@ -1,39 +0,0 @@
name: Autosquash
on:
check_run:
types:
# Check runs completing successfully can unblock the
# corresponding pull requests and make them mergeable.
- completed
pull_request:
types:
# A closed pull request makes the checks on the other
# pull request on the same base outdated.
- closed
# Adding the autosquash label to a pull request can
# trigger an update or a merge.
- labeled
pull_request_review:
types:
# Review approvals can unblock the pull request and
# make it mergeable.
- submitted
# Success statuses can unblock the corresponding
# pull requests and make them mergeable.
status: {}
jobs:
autosquash:
name: Autosquash
runs-on: ubuntu-18.04
steps:
- uses: tibdex/autosquash@v2
with:
# We can't use the built-in secrets.GITHUB_TOKEN yet because of this limitation:
# https://github.community/t5/GitHub-Actions/Triggering-a-new-workflow-from-another-workflow/td-p/31676
# In the meantime, use a token granting write access on the repo:
# - a GitHub App token
# See https://github.com/marketplace/actions/github-app-token.
# - a personal access token
# See https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line.
github_token: ${{ secrets.AUTOSQUASH_TOKEN }}

View file

@ -7,22 +7,68 @@ on:
jobs: jobs:
create-binaries: create-windows-binaries:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macOS-latest, windows-latest] conf: [x86_64, i686]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.conf }}-pc-windows-msvc
override: true
- name: Build oxipng
run: |
cargo build --release --target ${{ matrix.conf }}-pc-windows-msvc
- name: Get the version
shell: bash
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "::set-output name=tag::$VERSION"
- name: Build package
id: package
shell: bash
run: |
ARCHIVE_TARGET="${{ matrix.conf }}-pc-windows-msvc"
ARCHIVE_NAME="oxipng-${{ steps.tagName.outputs.tag }}-$ARCHIVE_TARGET"
ARCHIVE_FILE="${ARCHIVE_NAME}.zip"
mv LICENSE LICENSE.txt
7z a ${ARCHIVE_FILE} \
./target/${{ matrix.conf }}-pc-windows-msvc/release/oxipng.exe \
./CHANGELOG.md ./LICENSE.txt ./README.md
echo "::set-output name=file::${ARCHIVE_FILE}"
echo "::set-output name=name::${ARCHIVE_NAME}.zip"
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ steps.package.outputs.name }}
path: ${{ steps.package.outputs.file }}
create-unix-binaries:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include: include:
- os: ubuntu-latest - os: ubuntu-latest
target: x86_64-unknown-linux-musl target: x86_64-unknown-linux-musl
- os: macOS-latest - os: macos-latest
target: x86_64-apple-darwin target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-msvc
runs-on: '${{ matrix.os }}' runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -36,19 +82,19 @@ jobs:
override: true override: true
- name: Install musl - name: Install musl
run: sudo apt-get install musl-tools
if: contains(matrix.target, 'linux-musl') if: contains(matrix.target, 'linux-musl')
run: |
sudo apt-get install musl-tools
- name: Build oxipng - name: Build oxipng
run: | run: |
cargo build --release --target ${{ matrix.target }} cargo build --release --target ${{ matrix.target }}
- name: Strip binary - name: Strip binary
run: strip 'target/${{ matrix.target }}/release/oxipng' run: |
if: "!contains(matrix.target, 'windows')" strip target/${{ matrix.target }}/release/oxipng
- name: Get the version - name: Get the version
shell: bash
id: tagName id: tagName
run: | run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2) VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
@ -56,23 +102,17 @@ jobs:
- name: Build package - name: Build package
id: package id: package
shell: bash
run: | run: |
ARCHIVE_NAME="oxipng-${{ steps.tagName.outputs.tag }}-${{ matrix.target }}" ARCHIVE_TARGET=${{ matrix.target }}
if [[ '${{ matrix.target }}' == *windows* ]]; then ARCHIVE_NAME="oxipng-${{ steps.tagName.outputs.tag }}-$ARCHIVE_TARGET"
ARCHIVE_FILE="${ARCHIVE_NAME}.zip" ARCHIVE_FILE="${ARCHIVE_NAME}.tar.gz"
mv LICENSE LICENSE.txt mkdir "/tmp/${ARCHIVE_NAME}"
7z a "${ARCHIVE_FILE}" "./target/${{ matrix.target }}/release/oxipng.exe" ./CHANGELOG.md ./LICENSE.txt ./README.md cp README.md CHANGELOG.md LICENSE \
echo ::set-output "name=file::${ARCHIVE_FILE}" target/${{ matrix.target }}/release/oxipng \
echo ::set-output "name=name::${ARCHIVE_NAME}.zip" /tmp/${ARCHIVE_NAME}
else tar -czf ${PWD}/${ARCHIVE_FILE} -C /tmp/ ${ARCHIVE_NAME}
ARCHIVE_FILE="${ARCHIVE_NAME}.tar.gz" echo ::set-output "name=file::${ARCHIVE_FILE}"
mkdir "/tmp/${ARCHIVE_NAME}" echo ::set-output "name=name::${ARCHIVE_NAME}.tar.gz"
cp README.md CHANGELOG.md LICENSE "target/${{ matrix.target }}/release/oxipng" "/tmp/${ARCHIVE_NAME}"
tar -czf "${PWD}/${ARCHIVE_FILE}" -C /tmp/ "${ARCHIVE_NAME}"
echo ::set-output "name=file::${ARCHIVE_FILE}"
echo ::set-output "name=name::${ARCHIVE_NAME}.tar.gz"
fi
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
@ -80,9 +120,10 @@ jobs:
name: ${{ steps.package.outputs.name }} name: ${{ steps.package.outputs.name }}
path: ${{ steps.package.outputs.file }} path: ${{ steps.package.outputs.file }}
deploy: deploy:
needs: create-binaries needs: [create-windows-binaries, create-unix-binaries]
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -19,7 +19,7 @@ jobs:
- x86_64-apple-darwin - x86_64-apple-darwin
toolchain: toolchain:
# Minimum stable # Minimum stable
- "1.41.0" - "1.45.0"
- stable - stable
- beta - beta
- nightly - nightly

457
Cargo.lock generated
View file

@ -4,618 +4,647 @@
name = "adler" name = "adler"
version = "0.2.3" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
[[package]] [[package]]
name = "adler32" name = "adler32"
version = "1.2.0" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
[[package]] [[package]]
name = "ansi_term" name = "ansi_term"
version = "0.11.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
dependencies = [ dependencies = [
"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi",
] ]
[[package]] [[package]]
name = "atty" name = "atty"
version = "0.2.14" version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [ dependencies = [
"hermit-abi 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hermit-abi",
"libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)", "libc",
"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi",
] ]
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.0.1" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]] [[package]]
name = "bit-vec" name = "bit-vec"
version = "0.6.2" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.2.1" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]] [[package]]
name = "build_const" name = "build_const"
version = "0.2.1" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"
[[package]] [[package]]
name = "bytemuck" name = "bytemuck"
version = "1.4.1" version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac"
[[package]] [[package]]
name = "byteorder" name = "byteorder"
version = "1.3.4" version = "1.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.60" version = "1.0.61"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "0.1.10" version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "chrono" name = "chrono"
version = "0.4.18" version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
dependencies = [ dependencies = [
"libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)", "libc",
"num-integer 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer",
"num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits",
"time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", "time",
"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi",
] ]
[[package]] [[package]]
name = "clap" name = "clap"
version = "2.33.3" version = "2.33.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
dependencies = [ dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "ansi_term",
"atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "atty",
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags",
"strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "strsim",
"textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap",
"unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width",
"vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map",
] ]
[[package]] [[package]]
name = "cloudflare-zlib" name = "cloudflare-zlib"
version = "0.2.5" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5ed63a019d55bacd15cadcbcb96bf41b16281417fff393bdb55fa84255fe4b9"
dependencies = [ dependencies = [
"cloudflare-zlib-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cloudflare-zlib-sys",
] ]
[[package]] [[package]]
name = "cloudflare-zlib-sys" name = "cloudflare-zlib-sys"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e195cb274a0d6ee87e718838a09baecd7cbc9f6075dac256a84cb5842739c06"
dependencies = [ dependencies = [
"cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)", "cc",
] ]
[[package]]
name = "color_quant"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
name = "const_fn"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab"
[[package]] [[package]]
name = "crc" name = "crc"
version = "1.8.1" version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
dependencies = [ dependencies = [
"build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "build_const",
] ]
[[package]] [[package]]
name = "crc32fast" name = "crc32fast"
version = "1.2.0" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
dependencies = [ dependencies = [
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 1.0.0",
] ]
[[package]] [[package]]
name = "crossbeam-channel" name = "crossbeam-channel"
version = "0.4.4" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775"
dependencies = [ dependencies = [
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 1.0.0",
"maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils",
] ]
[[package]] [[package]]
name = "crossbeam-deque" name = "crossbeam-deque"
version = "0.7.3" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
dependencies = [ dependencies = [
"crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 1.0.0",
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-epoch",
"maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils",
] ]
[[package]] [[package]]
name = "crossbeam-epoch" name = "crossbeam-epoch"
version = "0.8.2" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 1.0.0",
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "const_fn",
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static",
"maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset",
"memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard",
"scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.7.2" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 1.0.0",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "const_fn",
"lazy_static",
] ]
[[package]] [[package]]
name = "deflate" name = "deflate"
version = "0.8.6" version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174"
dependencies = [ dependencies = [
"adler32 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "adler32",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder",
] ]
[[package]] [[package]]
name = "either" name = "either"
version = "1.6.1" version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]] [[package]]
name = "glob" name = "glob"
version = "0.3.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.9.0" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.1.16" version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
dependencies = [ dependencies = [
"libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)", "libc",
] ]
[[package]] [[package]]
name = "image" name = "image"
version = "0.23.10" version = "0.23.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4f0a8345b33b082aedec2f4d7d4a926b845cee184cbe78b703413066564431b"
dependencies = [ dependencies = [
"bytemuck 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "bytemuck",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder",
"num-iter 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "color_quant",
"num-rational 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter",
"num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "num-rational",
"png 0.16.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits",
"png",
] ]
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "1.6.0" version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
"hashbrown 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown",
"rayon 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon",
] ]
[[package]] [[package]]
name = "itertools" name = "itertools"
version = "0.9.0" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
dependencies = [ dependencies = [
"either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "either",
] ]
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.77" version = "0.2.80"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
[[package]] [[package]]
name = "libdeflate-sys" name = "libdeflate-sys"
version = "0.5.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21e39efa87b84db3e13ff4e2dfac1e57220abcbd7fe8ec44d238f7f4f787cc1f"
dependencies = [ dependencies = [
"cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)", "cc",
] ]
[[package]] [[package]]
name = "libdeflater" name = "libdeflater"
version = "0.5.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4810980d791f26d470e2d7d91a3d4d22aa3a4b709fb7e9c5e43ee54f83a01f2"
dependencies = [ dependencies = [
"libdeflate-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "libdeflate-sys",
] ]
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.11" version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
dependencies = [ dependencies = [
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.10",
] ]
[[package]]
name = "maybe-uninit"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "memoffset" name = "memoffset"
version = "0.5.6" version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
] ]
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.3.7" version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435"
dependencies = [ dependencies = [
"adler32 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "adler32",
] ]
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.4.2" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d"
dependencies = [ dependencies = [
"adler 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "adler",
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
] ]
[[package]] [[package]]
name = "num-integer" name = "num-integer"
version = "0.1.43" version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
"num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits",
] ]
[[package]] [[package]]
name = "num-iter" name = "num-iter"
version = "0.1.41" version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
"num-integer 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer",
"num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits",
] ]
[[package]] [[package]]
name = "num-rational" name = "num-rational"
version = "0.3.0" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5fa6d5f418879385b213d905f7cf5bf4aa553d4c380f0152d1d4f2749186fa9"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
"num-integer 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer",
"num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits",
] ]
[[package]] [[package]]
name = "num-traits" name = "num-traits"
version = "0.2.12" version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
] ]
[[package]] [[package]]
name = "num_cpus" name = "num_cpus"
version = "1.13.0" version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
dependencies = [ dependencies = [
"hermit-abi 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hermit-abi",
"libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)", "libc",
] ]
[[package]] [[package]]
name = "oxipng" name = "oxipng"
version = "3.0.1" version = "3.0.1"
dependencies = [ dependencies = [
"bit-vec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "bit-vec",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder",
"clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)", "clap",
"cloudflare-zlib 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "cloudflare-zlib",
"crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "crc",
"image 0.23.10 (registry+https://github.com/rust-lang/crates.io-index)", "image",
"indexmap 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap",
"itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools",
"libdeflater 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "libdeflater",
"log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "log",
"miniz_oxide 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide 0.4.3",
"rayon 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon",
"rgb 0.8.25 (registry+https://github.com/rust-lang/crates.io-index)", "rgb",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version",
"stderrlog 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "stderrlog",
"wild 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "wild",
"zopfli 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "zopfli",
]
[[package]]
name = "pest"
version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53"
dependencies = [
"ucd-trie",
] ]
[[package]] [[package]]
name = "png" name = "png"
version = "0.16.7" version = "0.16.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfe7f9f1c730833200b134370e1d5098964231af8450bce9b78ee3ab5278b970"
dependencies = [ dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags",
"crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "crc32fast",
"deflate 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", "deflate",
"miniz_oxide 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide 0.3.7",
] ]
[[package]] [[package]]
name = "rayon" name = "rayon"
version = "1.4.0" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
dependencies = [ dependencies = [
"autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "autocfg",
"crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque",
"either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "either",
"rayon-core 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon-core",
] ]
[[package]] [[package]]
name = "rayon-core" name = "rayon-core"
version = "1.8.1" version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
dependencies = [ dependencies = [
"crossbeam-channel 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel",
"crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque",
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static",
"num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus",
] ]
[[package]] [[package]]
name = "rgb" name = "rgb"
version = "0.8.25" version = "0.8.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "287f3c3f8236abb92d8b7e36797f19159df4b58f0a658cc3fb6dd3004b1f3bd3"
dependencies = [ dependencies = [
"bytemuck 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "bytemuck",
] ]
[[package]] [[package]]
name = "rustc_version" name = "rustc_version"
version = "0.2.3" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65c94201b44764d6d1f7e37c15a8289ed55e546c1762c7f1d57f616966e0c181"
dependencies = [ dependencies = [
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver",
] ]
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.1.0" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]] [[package]]
name = "semver" name = "semver"
version = "0.9.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6"
dependencies = [ dependencies = [
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver-parser",
] ]
[[package]] [[package]]
name = "semver-parser" name = "semver-parser"
version = "0.7.0" version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42ef146c2ad5e5f4b037cd6ce2ebb775401729b19a82040c1beac9d36c7d1428"
dependencies = [
"pest",
]
[[package]] [[package]]
name = "stderrlog" name = "stderrlog"
version = "0.5.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b02f316286ae558d83acc93dd81eaba096e746987a7961d4a9ae026842bae67f"
dependencies = [ dependencies = [
"atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "atty",
"chrono 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)", "chrono",
"log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "log",
"termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor",
"thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local",
] ]
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.8.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.1.0" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
dependencies = [ dependencies = [
"winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util",
] ]
[[package]] [[package]]
name = "textwrap" name = "textwrap"
version = "0.11.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
dependencies = [ dependencies = [
"unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width",
] ]
[[package]] [[package]]
name = "thread_local" name = "thread_local"
version = "1.0.1" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
dependencies = [ dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static",
] ]
[[package]] [[package]]
name = "time" name = "time"
version = "0.1.44" version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
dependencies = [ dependencies = [
"libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)", "libc",
"wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", "wasi",
"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi",
] ]
[[package]] [[package]]
name = "typed-arena" name = "typed-arena"
version = "1.7.0" version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d"
[[package]]
name = "ucd-trie"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
version = "0.1.8" version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
[[package]] [[package]]
name = "vec_map" name = "vec_map"
version = "0.8.2" version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.10.0+wasi-snapshot-preview1" version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]] [[package]]
name = "wild" name = "wild"
version = "2.0.4" version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "035793abb854745033f01a07647a79831eba29ec0be377205f2a25b0aa830020"
dependencies = [ dependencies = [
"glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "glob",
] ]
[[package]] [[package]]
name = "winapi" name = "winapi"
version = "0.3.9" version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [ dependencies = [
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-x86_64-pc-windows-gnu",
] ]
[[package]] [[package]]
name = "winapi-i686-pc-windows-gnu" name = "winapi-i686-pc-windows-gnu"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]] [[package]]
name = "winapi-util" name = "winapi-util"
version = "0.1.5" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [ dependencies = [
"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi",
] ]
[[package]] [[package]]
name = "winapi-x86_64-pc-windows-gnu" name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]] [[package]]
name = "zopfli" name = "zopfli"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4079b79464426ade2a1b0177fb0ce8396ba6b4084267407e333573c666073964"
dependencies = [ dependencies = [
"adler32 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "adler32",
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder",
"crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "crc",
"typed-arena 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "typed-arena",
] ]
[metadata]
"checksum adler 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
"checksum adler32 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
"checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
"checksum bit-vec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3"
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
"checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"
"checksum bytemuck 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac"
"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
"checksum cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)" = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c"
"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
"checksum chrono 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d021fddb7bd3e734370acfa4a83f34095571d8570c039f1420d77540f68d5772"
"checksum clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)" = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
"checksum cloudflare-zlib 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ed63a019d55bacd15cadcbcb96bf41b16281417fff393bdb55fa84255fe4b9"
"checksum cloudflare-zlib-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7e195cb274a0d6ee87e718838a09baecd7cbc9f6075dac256a84cb5842739c06"
"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
"checksum crossbeam-channel 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285"
"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
"checksum deflate 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174"
"checksum either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
"checksum hashbrown 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "00d63df3d41950fb462ed38308eea019113ad1508da725bbedcd0fa5a85ef5f7"
"checksum hermit-abi 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151"
"checksum image 0.23.10 (registry+https://github.com/rust-lang/crates.io-index)" = "985fc06b1304d19c28d5c562ed78ef5316183f2b0053b46763a0b94862373c34"
"checksum indexmap 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2"
"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
"checksum libdeflate-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "21e39efa87b84db3e13ff4e2dfac1e57220abcbd7fe8ec44d238f7f4f787cc1f"
"checksum libdeflater 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4810980d791f26d470e2d7d91a3d4d22aa3a4b709fb7e9c5e43ee54f83a01f2"
"checksum log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
"checksum memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa"
"checksum miniz_oxide 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435"
"checksum miniz_oxide 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9"
"checksum num-integer 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"
"checksum num-iter 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f"
"checksum num-rational 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b4d7360f362cfb50dde8143501e6940b22f644be75a4cc90b2d81968908138"
"checksum num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
"checksum png 0.16.7 (registry+https://github.com/rust-lang/crates.io-index)" = "dfe7f9f1c730833200b134370e1d5098964231af8450bce9b78ee3ab5278b970"
"checksum rayon 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfd016f0c045ad38b5251be2c9c0ab806917f82da4d36b2a327e5166adad9270"
"checksum rayon-core 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e8c4fec834fb6e6d2dd5eece3c7b432a52f0ba887cf40e595190c4107edc08bf"
"checksum rgb 0.8.25 (registry+https://github.com/rust-lang/crates.io-index)" = "287f3c3f8236abb92d8b7e36797f19159df4b58f0a658cc3fb6dd3004b1f3bd3"
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum stderrlog 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b02f316286ae558d83acc93dd81eaba096e746987a7961d4a9ae026842bae67f"
"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
"checksum termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
"checksum time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
"checksum typed-arena 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d"
"checksum unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
"checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
"checksum wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
"checksum wild 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "035793abb854745033f01a07647a79831eba29ec0be377205f2a25b0aa830020"
"checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum zopfli 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4079b79464426ade2a1b0177fb0ce8396ba6b4084267407e333573c666073964"

View file

@ -33,17 +33,17 @@ bit-vec = "^0.6.2"
byteorder = "^1.0.0" byteorder = "^1.0.0"
crc = "^1.2.0" crc = "^1.2.0"
itertools = "^0.9.0" itertools = "^0.9.0"
zopfli = "^0.4.0" zopfli = { version = "^0.4.0", optional = true }
miniz_oxide = "0.4" miniz_oxide = "0.4"
rgb = "0.8.25" rgb = "0.8.25"
indexmap = "1.6.0" indexmap = "1.6.0"
libdeflater = "0.5.0" libdeflater = { version = "0.5.0", optional = true }
log = "0.4.11" log = "0.4.11"
stderrlog = { version = "0.5.0", optional = true } stderrlog = { version = "0.5.0", optional = true }
[dependencies.rayon] [dependencies.rayon]
optional = true optional = true
version = "^1.4.0" version = "^1.5.0"
[dependencies.clap] [dependencies.clap]
optional = true optional = true
@ -63,7 +63,7 @@ features = ["arm-always"]
version = "^0.2.2" version = "^0.2.2"
[build-dependencies] [build-dependencies]
rustc_version = "0.2" rustc_version = "0.3"
[features] [features]
binary = [ binary = [
@ -71,7 +71,7 @@ binary = [
"wild", "wild",
"stderrlog", "stderrlog",
] ]
default = ["binary", "parallel"] default = ["binary", "parallel", "libdeflater", "zopfli"]
parallel = ["rayon", "indexmap/rayon"] parallel = ["rayon", "indexmap/rayon"]
[lib] [lib]

View file

@ -30,7 +30,7 @@ cargo build --release
cp target/release/oxipng /usr/local/bin cp target/release/oxipng /usr/local/bin
``` ```
The current minimum supported Rust version is **1.41.0**. The current minimum supported Rust version is **1.47.0**.
Oxipng follows Semantic Versioning. Oxipng follows Semantic Versioning.

View file

@ -30,7 +30,7 @@ cargo build --release
cp target/release/oxipng /usr/local/bin cp target/release/oxipng /usr/local/bin
``` ```
The current minimum supported Rust version is **1.41.0**. The current minimum supported Rust version is **1.47.0**.
Oxipng follows Semantic Versioning. Oxipng follows Semantic Versioning.

View file

@ -1,5 +1,5 @@
use std::sync::atomic::AtomicUsize; use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::{Relaxed, SeqCst}; use std::sync::atomic::Ordering::SeqCst;
#[derive(Debug)] #[derive(Debug)]
pub struct AtomicMin { pub struct AtomicMin {
@ -28,18 +28,6 @@ impl AtomicMin {
} }
pub fn set_min(&self, new_val: usize) { pub fn set_min(&self, new_val: usize) {
let mut current_val = self.val.load(Relaxed); self.val.fetch_min(new_val, SeqCst);
loop {
if new_val < current_val {
if let Err(v) = self
.val
.compare_exchange(current_val, new_val, SeqCst, Relaxed)
{
current_val = v;
continue;
}
}
break;
}
} }
} }

View file

@ -3,12 +3,13 @@ use crate::error::PngError;
use crate::Deadline; use crate::Deadline;
use crate::PngResult; use crate::PngResult;
use indexmap::IndexSet; use indexmap::IndexSet;
use std::cmp::max;
#[doc(hidden)] #[doc(hidden)]
pub mod miniz_stream; pub mod miniz_stream;
#[cfg(feature = "libdeflater")]
mod deflater; mod deflater;
#[cfg(feature = "libdeflater")]
pub use deflater::deflate as libdeflater_deflate; pub use deflater::deflate as libdeflater_deflate;
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
@ -47,7 +48,10 @@ pub fn deflate(
miniz_stream::compress_to_vec_oxipng(data, zc, zw.into(), zs.into(), max_size, deadline) miniz_stream::compress_to_vec_oxipng(data, zc, zw.into(), zs.into(), max_size, deadline)
} }
#[cfg(feature = "zopfli")]
pub fn zopfli_deflate(data: &[u8]) -> PngResult<Vec<u8>> { pub fn zopfli_deflate(data: &[u8]) -> PngResult<Vec<u8>> {
use std::cmp::max;
let mut output = Vec::with_capacity(max(1024, data.len() / 20)); let mut output = Vec::with_capacity(max(1024, data.len() / 20));
let options = zopfli::Options::default(); let options = zopfli::Options::default();
match zopfli::compress(&options, &zopfli::Format::Zlib, data, &mut output) { match zopfli::compress(&options, &zopfli::Format::Zlib, data, &mut output) {
@ -79,8 +83,10 @@ pub enum Deflaters {
/// Default: `15` /// Default: `15`
window: u8, window: u8,
}, },
#[cfg(feature = "zopfli")]
/// Use the better but slower Zopfli implementation /// Use the better but slower Zopfli implementation
Zopfli, Zopfli,
#[cfg(feature = "libdeflater")]
/// Use libdeflater. /// Use libdeflater.
Libdeflater, Libdeflater,
} }

View file

@ -12,6 +12,11 @@
#![warn(clippy::path_buf_push_overwrite)] #![warn(clippy::path_buf_push_overwrite)]
#![warn(clippy::range_plus_one)] #![warn(clippy::range_plus_one)]
#![allow(clippy::cognitive_complexity)] #![allow(clippy::cognitive_complexity)]
#![cfg_attr(
not(any(feature = "libdeflater", feature = "zopfli")),
allow(irrefutable_let_patterns),
allow(unreachable_patterns)
)]
#[cfg(feature = "parallel")] #[cfg(feature = "parallel")]
extern crate rayon; extern crate rayon;
@ -569,7 +574,9 @@ fn optimize_png(
&best_size, &best_size,
&deadline, &deadline,
), ),
#[cfg(feature = "zopfli")]
Deflaters::Zopfli => deflate::zopfli_deflate(filtered), Deflaters::Zopfli => deflate::zopfli_deflate(filtered),
#[cfg(feature = "libdeflater")]
Deflaters::Libdeflater => deflate::libdeflater_deflate(filtered, &best_size), Deflaters::Libdeflater => deflate::libdeflater_deflate(filtered, &best_size),
}; };

View file

@ -10,7 +10,7 @@ use indexmap::IndexMap;
use rgb::ComponentSlice; use rgb::ComponentSlice;
use rgb::RGBA8; use rgb::RGBA8;
use std::fs::File; use std::fs::File;
use std::io::{Read, Seek, SeekFrom}; use std::io::{BufReader, Read};
use std::iter::Iterator; use std::iter::Iterator;
use std::path::Path; use std::path::Path;
use std::sync::Arc; use std::sync::Arc;
@ -62,25 +62,24 @@ impl PngData {
} }
pub fn read_file(filepath: &Path) -> Result<Vec<u8>, PngError> { pub fn read_file(filepath: &Path) -> Result<Vec<u8>, PngError> {
let mut file = match File::open(filepath) { let file = match File::open(filepath) {
Ok(f) => f, Ok(f) => f,
Err(_) => return Err(PngError::new("Failed to open file for reading")), Err(_) => return Err(PngError::new("Failed to open file for reading")),
}; };
let file_len = file.metadata().map(|m| m.len() as usize).unwrap_or(0);
let mut reader = BufReader::new(file);
// Check file for PNG header // Check file for PNG header
let mut header = [0; 8]; let mut header = [0; 8];
if file.read_exact(&mut header).is_err() { if reader.read_exact(&mut header).is_err() {
return Err(PngError::new("Not a PNG file: too small")); return Err(PngError::new("Not a PNG file: too small"));
} }
if !file_header_is_valid(&header) { if !file_header_is_valid(&header) {
return Err(PngError::new("Invalid PNG header detected")); return Err(PngError::new("Invalid PNG header detected"));
} }
if file.seek(SeekFrom::Start(0)).is_err() {
return Err(PngError::new("Failed to read from file"));
}
// Read raw png data into memory // Read raw png data into memory
let mut byte_data: Vec<u8> = let mut byte_data: Vec<u8> = Vec::with_capacity(file_len);
Vec::with_capacity(file.metadata().map(|m| m.len() as usize).unwrap_or(0)); byte_data.extend_from_slice(&header);
match file.read_to_end(&mut byte_data) { match reader.read_to_end(&mut byte_data) {
Ok(_) => (), Ok(_) => (),
Err(_) => return Err(PngError::new("Failed to read from file")), Err(_) => return Err(PngError::new("Failed to read from file")),
} }

View file

@ -64,9 +64,7 @@ fn reduced_alpha_to_black(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
reduced.push(line.filter); reduced.push(line.filter);
for pixel in line.data.chunks(bpp) { for pixel in line.data.chunks(bpp) {
if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 { if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 {
for _ in 0..bpp { reduced.resize(reduced.len() + bpp, 0);
reduced.push(0);
}
} else { } else {
reduced.extend_from_slice(pixel); reduced.extend_from_slice(pixel);
} }
@ -81,12 +79,8 @@ fn reduced_alpha_to_white(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
reduced.push(line.filter); reduced.push(line.filter);
for pixel in line.data.chunks(bpp) { for pixel in line.data.chunks(bpp) {
if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 { if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 {
for _ in 0..(bpp - bpc) { reduced.resize(reduced.len() + bpp - bpc, 255);
reduced.push(255); reduced.resize(reduced.len() + bpc, 0);
}
for _ in 0..bpc {
reduced.push(0);
}
} else { } else {
reduced.extend_from_slice(pixel); reduced.extend_from_slice(pixel);
} }
@ -109,9 +103,7 @@ fn reduced_alpha_to_up(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
for (pixel, last_pixel) in line.data.chunks(bpp).zip(last_line.chunks(bpp)) { for (pixel, last_pixel) in line.data.chunks(bpp).zip(last_line.chunks(bpp)) {
if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 { if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 {
current_line.extend_from_slice(&last_pixel[0..(bpp - bpc)]); current_line.extend_from_slice(&last_pixel[0..(bpp - bpc)]);
for _ in 0..bpc { current_line.resize(current_line.len() + bpc, 0);
current_line.push(0);
}
} else { } else {
current_line.extend_from_slice(pixel); current_line.extend_from_slice(pixel);
} }
@ -134,9 +126,7 @@ fn reduced_alpha_to_down(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
for (pixel, last_pixel) in line.data.chunks(bpp).zip(last_line.chunks(bpp)) { for (pixel, last_pixel) in line.data.chunks(bpp).zip(last_line.chunks(bpp)) {
if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 { if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 {
reduced.extend_from_slice(&last_pixel[0..(bpp - bpc)]); reduced.extend_from_slice(&last_pixel[0..(bpp - bpc)]);
for _ in 0..bpc { reduced.resize(reduced.len() + bpc, 0);
reduced.push(0);
}
} else { } else {
reduced.extend_from_slice(pixel); reduced.extend_from_slice(pixel);
} }
@ -154,9 +144,7 @@ fn reduced_alpha_to_left(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
for pixel in line.data.chunks(bpp).rev() { for pixel in line.data.chunks(bpp).rev() {
if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 { if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 {
line_bytes.extend_from_slice(&last_pixel[0..(bpp - bpc)]); line_bytes.extend_from_slice(&last_pixel[0..(bpp - bpc)]);
for _ in 0..bpc { line_bytes.resize(line_bytes.len() + bpc, 0);
line_bytes.push(0);
}
} else { } else {
line_bytes.extend_from_slice(pixel); line_bytes.extend_from_slice(pixel);
} }
@ -176,9 +164,7 @@ fn reduced_alpha_to_right(png: &PngImage, bpc: usize, bpp: usize) -> Vec<u8> {
for pixel in line.data.chunks(bpp) { for pixel in line.data.chunks(bpp) {
if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 { if pixel.iter().skip(bpp - bpc).fold(0, |sum, i| sum | i) == 0 {
reduced.extend_from_slice(&last_pixel[0..(bpp - bpc)]); reduced.extend_from_slice(&last_pixel[0..(bpp - bpc)]);
for _ in 0..bpc { reduced.resize(reduced.len() + bpc, 0);
reduced.push(0);
}
} else { } else {
reduced.extend_from_slice(pixel); reduced.extend_from_slice(pixel);
} }