Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add ImageCompressionBear #1302

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yukiisbored
Copy link
Member

ImageCompressionBear is a bear which uses optimage, jpegoptim, jpegtran,
pngcrush, optipng to see if the image can be compressed and how much
bytes will be reduced if it's compressed.

Closes #1259

@gitmate-bot
Copy link
Collaborator

Thanks for your contribution!

Reviewing pull requests take really a lot of time and we're all volunteers. Please make sure you go through the following check list and complete them all before pinging someone for a review.

As you learn things over your Pull Request please help others on the chat and on PRs to get their stuff right as well!

@yukiisbored yukiisbored force-pushed the image-compressor-bear branch 2 times, most recently from de7f821 to e8d5aea Compare January 13, 2017 15:07
@yukiisbored yukiisbored force-pushed the image-compressor-bear branch from e8d5aea to 7f6bd36 Compare January 13, 2017 15:22
CAN_DETECT = {'Compression', 'Useless metadata'}

@classmethod
def check_prerequisites(cls):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this is the fact DistributionRequirement doesn't implement is_installed. Related issue: https://gitlab.com/coala/package_manager/issues/11

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed upstream

@yukiisbored
Copy link
Member Author

yukiisbored commented Jan 15, 2017

This PR requires https://gitlab.com/coala/package_manager/merge_requests/13 and https://github.com/coala/coala/pull/3560/files to be merged before this. Gonna rewrite the bear into a GlobalBear

@AsnelChristian
Copy link
Member

in that case i am marking WIP, @yukiisbored 😅

from coala_utils.FileUtils import create_tempfile


class ImageCompressionBear(LocalBear):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm... you should add, a short description of this bear, and a link to where more information can be fetch

AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'The coala developers'}
LICENSE = 'AGPL-3.0'
CAN_DETECT = {'Compression', 'Useless metadata'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push a commit to the coala rep that adds these

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

3 similar comments
@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@yukiisbored
Copy link
Member Author

This PR is on hold, due to unresolved issues on gitlab.com/coala/package_manager related to handling DistributionRequirement and ExecutableRequirement fallback.

@nemani
Copy link
Member

nemani commented Feb 16, 2017

@yukiisbored Add WIP: to the title of the PR.

@yukiisbored yukiisbored changed the title Add ImageCompressionBear WIP: Add ImageCompressionBear Feb 17, 2017
@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

1 similar comment
@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

5 similar comments
@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

3 similar comments
@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@jayvdb
Copy link
Member

jayvdb commented Jun 13, 2017

coala/coala#3560 is merged. This bear can now proceed.

@yukiisbored yukiisbored force-pushed the image-compressor-bear branch 3 times, most recently from d586635 to cdb357b Compare June 14, 2017 04:16
@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

2 similar comments
@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

@yukiisbored
Copy link
Member Author

This bear cannot proceed efficiently without fixing the issues related to DistributionRequirement and AnyOneOfRequirement

@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

1 similar comment
@gitmate-bot
Copy link
Collaborator

Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again!

ImageCompressionBear is a bear which uses optimage, jpegoptim, jpegtran,
pngcrush, optipng to see if the image can be compressed and how much
bytes will be reduced if it's compressed.

Closes coala#1259
@@ -53,6 +53,10 @@ addons:
- opam
- php-codesniffer
- verilator
- jpegoptim
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the templates will now automatically generate this for the precise job.

Ideally, you also add it to either the hand coded xenial or trusty job that run in the first batch of jobs, in .moban.dt/travis-manual-matrix.yaml

ExecutableRequirement('optipng')
]),
AnyOneOfRequirements([
DistributionRequirement(apt_get='zopfli',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zopflipng wouldn't get installed on Ubuntu 16.04 which travis runs. by apt-get zopfli.

To install zopflipng:

git clone https://github.com/google/zopfli.git
cd zopfli
make zopflipng
install -Dm755 zopflipng /usr/local/bin/zopflipng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

8 participants