Skip to content

Commit

Permalink
Merge pull request #15 from VirtuBox/develop
Browse files Browse the repository at this point in the history
v2.0
  • Loading branch information
VirtuBox authored Nov 11, 2020
2 parents 55dbd15 + 2696d18 commit 6c8104c
Show file tree
Hide file tree
Showing 10 changed files with 450 additions and 259 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
39 changes: 39 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Auto detect text files and perform LF normalization
* text=auto

# Documents
*.md text eol=lf
*.tex text diff=tex
*.adoc text
*.textile text
*.mustache text eol=lf
*.csv text
*.tab text
*.tsv text
*.txt text
*.sql text

# Scripts
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf

# Source files
# ============
*.pxd text diff=python
*.py text diff=python
*.py3 text diff=python
*.pyc text diff=python
*.pyd text diff=python
*.pyo text diff=python
*.pyw text diff=python
*.pyx text diff=python
*.pyz text diff=python


#
# Exclude files from exporting
#

.gitattributes export-ignore
.gitignore export-ignore
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches:
- develop
- master
pull_request:
branches:
- master
release:
types: [published]
schedule:
- cron: '0 0 * * 0'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a set of commands using the runners shell
- name: Install prerequesites
run: |
sudo apt-get update
sudo apt-get install jpegoptim -y
sudo -E time bash scripts/install-webp.sh > /dev/null 2>&1
sudo -E time bash scripts/install-optipng.sh > /dev/null 2>&1
sudo wget -qO /usr/local/bin/avif https://github.com/Kagami/go-avif/releases/download/v0.1.0/avif-linux-x64
sudo chmod +x /usr/local/bin/avif
sudo cp optimize.sh /usr/local/bin/img-optimize
sudo chmod 755 /usr/local/bin/img-optimize
- name: Optimize Images
run: |
ls -alh images/
/usr/local/bin/img-optimize --avif
ls -alh images/
/usr/local/bin/img-optimize --webp
ls -alh images/
rm -f images/*.webp images/*.avif
/usr/local/bin/img-optimize --all
ls -alh images/
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sudo: required
os: linux
dist: bionic

language: bash
language: shell

cache:
apt: true
Expand All @@ -10,21 +10,27 @@ git:
quiet: true

before_script:
- sudo apt-get install tree -y
- sudo apt-get -qq autoremove --purge
addons:
apt:
update: true

script:
- sudo apt-get install jpegoptim -y
- sudo bash scripts/install-webp.sh
- sudo bash scripts/install-optipng.sh
- sudo -E time bash scripts/install-webp.sh > /dev/null 2>&1
- sudo -E time bash scripts/install-optipng.sh > /dev/null 2>&1
- sudo wget -qO /usr/local/bin/avif https://github.com/Kagami/go-avif/releases/download/v0.1.0/avif-linux-x64
- sudo chmod +x /usr/local/bin/avif
- sudo cp optimize.sh /usr/local/bin/img-optimize
- sudo chmod 755 /usr/local/bin/img-optimize
- /usr/local/bin/img-optimize --all
- /usr/local/bin/img-optimize -jpg -q
- ls -alh images/
- /usr/local/bin/img-optimize --all -q
- ls -alh images/
- /usr/local/bin/img-optimize --jpg -q
- /usr/local/bin/img-optimize --png -q
- rm images/*.webp
- /usr/local/bin/img-optimize --webp
- tree -L 2 .
- rm images/*.webp
- /usr/local/bin/img-optimize --webp --quiet
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [V2.0] - 2020-11-10

### Added

- quiet mode
- option --no-run-if-empty added to xargs
- scripts to compile optipng & libwebp from source
- Avif (AV1 Image Format) support
- Avoid optimizing the same image at the same moment [PR #12](https://github.com/VirtuBox/img-optimize/pull/12)

### Changed

- JPG are optimized as progressive JPG
- WebP and Avif newly created images are deleted in case of failure during conversion

## [V1.1] - 2019-04-05

### Added
Expand Down
Loading

0 comments on commit 6c8104c

Please sign in to comment.