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

v2.0.0: Cross-platform command line executable support, parallel image file processing support #19

Merged
merged 97 commits into from
May 12, 2018

Conversation

chrissimpkins
Copy link
Owner

@chrissimpkins chrissimpkins commented Apr 5, 2018

v2.0.0 will include support for the following:

  • a new command line executable (crunch) that can be used on *nix platforms, including Linux, macOS, and Windows with *nix flavors like MinGW. e.g., crunch *.png. The goal is to replicate the files that are generated with the current macOS GUI and right click menu service tools in a cross-platform fashion. Big thanks to @perillamint for kickstarting the effort in PR Add Linux support #18!
  • support for parallel image processing on multi-image requests (with automated detection up to number of available processors on user system) across Crunch, Crunch macOS service, and crunch command line executable
  • automated local (off of system PATH) project dependency executable installation with statically compiled libraries to avoid the need for installation of these libraries through package managers/source prior to installs of crunch command line executable
  • new make target for command line dependency installation from source (make build-dependencies)
  • new make target for command line dependency uninstalls (make uninstall-dependencies)
  • new make target for installation of Crunch command line executable crunch (make install-executable)

AVAILABLE FOR TESTING:

Command Line Executable (crunch)

A version of the command line executable with support for parallel image processing is implemented and available for testing. Your help with testing and feedback re: any problems that arise would be extremely helpful.

You can test the crunch command line executable with the following series of install/usage commands:

# install steps from dev branch of repository

$ git clone https://github.com/chrissimpkins/Crunch.git
$ cd Crunch
$ git checkout dev
$ make build-dependencies
$ make install-executable

# Usage

$ crunch [png image path 1]...[png image path n]

# Uninstall executable

$ make uninstall-executable

# Uninstall dependencies

$ make uninstall-dependencies

macOS GUI application (Crunch)

The development Crunch.app package supports parallel image optimization on multi-processor machines. If you would like to test this pre-release version, you can find the Crunch.app package in the bin directory of the dev branch of the repository. Drag and drop this to your macOS Applications directory. Click on the icon to open the application and drag/drop one or more PNG files onto the application window.

macOS right click menu service (Crunch Image(s))

The right click menu service now supports parallel optimization of image files on multi-processor machines. From the root of the dev branch of the repository, install the right click menu service with:

$ make install-macos-service

Enter your password when prompted for it to install the right click service. This install requires sudo permissions. Note You must install the macOS GUI application, Crunch, before use of the right click menu service. See install instructions above.

Use the right click service by selecting one or more PNG files in Finder, right click, and select Crunch Image(s) from the Services menu. A spinning gear icon appears in the menu bar as the image processing executes and disappears when it is complete.


COMPLETED:

  • implement local pngquant and zopflipng source compilation script with statically linked dependencies for the projects (implemented as of 7560b6d, script: src/install-dependencies.sh)
  • add CI testing of dependency compiles from source as defined in src/install-dependencies.sh script
  • add CI testing for POSIX compliance of distributed shell scripts using shellcheck
  • link crunch execution to local installs of zopflipng and pngquant executables for all platforms
  • implement parallel image optimization support when user requests > 1 PNG image file across macOS GUI tool, macOS right click menu service, and crunch command line executable
  • implement make based install of crunchexecutable on path /usr/local/bin/crunch
  • implement make based uninstall of crunch executable
  • implement make based uninstall of project dependencies that are installed through make build-dependencies (make uninstall-dependencies)
  • add CI tests for crunch Python executable
  • add parallel image optimization support to macOS GUI
  • build new pngquant executable with statically linked libraries for distribution in macOS GUI app
  • build new zopflipng executable for distribution in macOS GUI app
  • add parallel image optimization support to macOS right click menu service
  • update in-application About window text for Crunch macOS GUI application
  • documentation of new crunch command line executable installation/uninstall/usage
  • documentation of new local build dependency install process to support the crunch executable
  • build v2.0.0 Crunch macOS GUI release
  • build Crunch dmg installer

@adidalal
Copy link

adidalal commented Apr 7, 2018

For macOS, homebrew cask specifically supports the binary stanza, which may make your life a bit easier.
See https://github.com/caskroom/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/binary.md

@chrissimpkins
Copy link
Owner Author

chrissimpkins commented Apr 7, 2018

@adidalal this automates install of a separate crunch executable in /usr/local/bin on install with cask?

@adidalal
Copy link

adidalal commented Apr 8, 2018

@chrissimpkins it symlinks to that location, yes. Source - https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cask/lib/hbc/artifact/binary.rb

@chrissimpkins
Copy link
Owner Author

Great thanks!

eliminates bug that led to hanging crash across Crunch, crunch, and Crunch Image(s) applications
@chrissimpkins chrissimpkins merged commit cdbf4f6 into master May 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants