Giter VIP home page Giter VIP logo

image_optim's Introduction

Gem Version Build Status Rubocop CodeQL Code Climate Code Climate Coverage Depfu Inch CI

image_optim

Command line tool and ruby interface to optimize (lossless compress, optionally lossy) jpeg, png, gif and svg images using external utilities:

Based on ImageOptim.app.

Documentation for latest gem version and master branch.

A test application with latest image_optim and image_optim_pack is available on render: https://iopack.onrender.com/.

Gem installation

gem install image_optim

You may also want to install image_optim_pack (see Binaries pack).

gem install image_optim_pack

Bundler

Add to your Gemfile:

gem 'image_optim'

With image_optim_pack:

gem 'image_optim'
gem 'image_optim_pack'

With version:

gem 'image_optim', '~> 0.31'

If you want to check latest changes:

gem 'image_optim', :git => 'git://github.com/toy/image_optim.git'

Docker

This gem is also be available as docker image containing most binaries:

docker run --rm ghcr.io/toy/image_optim --version # image_optim version
docker run --rm ghcr.io/toy/image_optim --info # image_optim info including bin versions
docker run --rm -v "$PWD":/here -w /here ghcr.io/toy/image_optim image-in-this-folder.jpg

See image_optim_pack repository for Dockerfile and instructions.

Binaries location

Simplest way for image_optim to locate binaries is to install them in common location present in PATH (see Binaries installation).

If you cannot install to common location, then install to custom one and add it to PATH.

Specify custom bin location using XXX_BIN environment variable (JPEGOPTIM_BIN, OPTIPNG_BIN, …).

Besides permanently setting environment variables in ~/.profile, ~/.bash_profile, ~/.bashrc, ~/.zshrc, … they can be set:

  • before command:

    PATH="/custom/location:$PATH" image_optim *.jpg

    for example:

    PATH="/Applications/ImageOptim.app/Contents/MacOS:$PATH" image_optim *.jpg

  • inside script:

    ENV['PATH'] = "/custom/location:#{ENV['PATH']}"; ImageOptim.optimize_images([…])

    for example:

    ENV['PATH'] = "/Applications/ImageOptim.app/Contents/MacOS:#{ENV['PATH']}"; ImageOptim.optimize_images([…])

Binaries installation

Binaries pack

Easiest way to get latest versions of most binaries for image_optim for Linux and Mac OS X is by installing image_optim_pack gem.

Check installation instructions in Gem installation section.

Pack doesn't include pngout and svgo binaries, their installation instructions are provided below.

Linux - Debian/Ubuntu

sudo apt-get install -y advancecomp gifsicle jhead jpegoptim libjpeg-progs optipng pngcrush pngquant

If you get an old version of pngquant, please check how to install up-to-date version or compile from source at http://pngquant.org/.

Linux - RHEL/Fedora/Centos

sudo yum install -y advancecomp gifsicle jhead libjpeg optipng pngquant

You may also need to install libjpeg-turbo-utils instead of libjpeg:

sudo yum install -y libjpeg-turbo-utils

You will also need to install jpegoptim and pngcrush from source:

jpegoptim

Replace X.Y.Z with latest version number from http://www.kokkonen.net/tjko/projects.html#jpegoptim.

JPEGOPTIM_VERSION=X.Y.Z
cd /tmp
curl -O http://www.kokkonen.net/tjko/src/jpegoptim-$JPEGOPTIM_VERSION.tar.gz
tar zxf jpegoptim-$JPEGOPTIM_VERSION.tar.gz
cd jpegoptim-$JPEGOPTIM_VERSION
./configure && make && make install

pngcrush

Replace X.Y.Z with latest version number from http://sourceforge.net/projects/pmt/files/pngcrush/.

PNGCRUSH_VERSION=X.Y.Z
cd /tmp
curl -O http://iweb.dl.sourceforge.net/project/pmt/pngcrush/$PNGCRUSH_VERSION/pngcrush-$PNGCRUSH_VERSION.tar.gz
tar zxf pngcrush-$PNGCRUSH_VERSION.tar.gz
cd pngcrush-$PNGCRUSH_VERSION
make && cp -f pngcrush /usr/local/bin

OS X: Macports

sudo port install advancecomp gifsicle jhead jpegoptim jpeg optipng pngcrush pngquant

OS X: Brew

brew install advancecomp gifsicle jhead jpegoptim jpeg optipng oxipng pngcrush pngquant jonof/kenutils/pngout

oxipng installation (optional)

Unless it is available in your chosen package manager, can be installed using cargo:

cargo install oxipng

pngout installation (optional)

If you installed the dependencies via brew, pngout should be installed already. Otherwise, you can install pngout by downloading and installing the binary versions.

Note: pngout is free to use even in commercial soft, but you can not redistribute, repackage or reuse it without consent and agreement of creator. license

svgo installation (optional)

svgo is available from NPM.

npm install -g svgo

If you prefer to install svgo to your project directory, use one of the following commands instead:

npm install svgo

yarn add svgo

When installing svgo to the project directory, you must add the following to your environment:

SVGO_BIN='node_modules/svgo/bin/svgo'

jpeg-recompress installation (optional)

Download and install the jpeg-recompress binary from the JPEG-Archive Releases page, or follow the instructions to build from source.

Usage

From shell

image_optim *.{jpg,png,gif,svg}

image_optim -r .

image_optim -h

From ruby

Initialize optimizer (or you can call optimization methods directly on ImageOptim):

image_optim = ImageOptim.new

image_optim = ImageOptim.new(:pngout => false)

image_optim = ImageOptim.new(:nice => 20)

Optimize image getting temp path:

image_optim.optimize_image('a.png')

Optimize image in place:

image_optim.optimize_image!('b.jpg')

Optimize image data:

image_optim.optimize_image_data(data)

Multiple images:

image_optim.optimize_images(Dir['*.png']) do |unoptimized, optimized|
  if optimized
    puts "#{unoptimized} => #{optimized}"
  end
end

image_optim.optimize_images!(Dir['*.*'])

image_optim.optimize_images_data(datas)

From rails

Rails image assets optimization is extracted into image_optim_rails gem.

Configuration

Configuration in YAML format will be read and prepended to options from two paths:

  • $XDG_CONFIG_HOME/image_optim.yml (by default ~/.config/image_optim.yml)
  • .image_optim.yml in current working directory

Paths can be changed using :config_paths option and --config-paths argument.

Example configuration:

nice: 20
pngout: false # disable
optipng:
  level: 5

Temporary directory

image_optim uses standard ruby library for creating temporary files. Temporary directory can be changed using one of TMPDIR, TMP or TEMP environment variables.

Options

  • :nice — Nice level, priority of all used tools with higher value meaning lower priority, in range -20..19, negative values can be set only if run by root user (defaults to 10)
  • :threads — Number of threads or disable (defaults to number of processors)
  • :verbose — Verbose output (defaults to false)
  • :pack — Require image_optim_pack or disable it, by default image_optim_pack will be used if available, will turn on :skip-missing-workers unless explicitly disabled (defaults to nil)
  • :skip_missing_workers — Skip workers with missing or problematic binaries (defaults to false)
  • :allow_lossy — Allow lossy workers and optimizations (defaults to false)
  • :cache_dir — Configure cache directory
  • :cache_worker_digests - Also cache worker digests along with original file digest and worker options: updating workers invalidates cache
  • :timeout — Maximum time in seconds to spend on one image, note multithreading and cache (defaults to unlimited)

Worker can be disabled by passing false instead of options hash or by setting option :disable to true.

advpng:

  • :level — Compression level: 0 - don't compress, 1 - fast, 2 - normal, 3 - extra, 4 - extreme (defaults to 4)

gifsicle:

  • :interlace — Interlace: true - interlace on, false - interlace off, nil - as is in original image (defaults to running two instances, one with interlace off and one with on)
  • :level — Compression level: 1 - light and fast, 2 - normal, 3 - heavy (slower) (defaults to 3)
  • :careful — Avoid bugs with some software (defaults to false)

jhead:

Worker has no options

jpegoptim:

  • :allow_lossy — Allow limiting maximum quality (defaults to false)
  • :strip — List of markers to strip: :com, :exif, :iptc, :icc, :xmp, :none or :all (defaults to :all)
  • :max_quality — Maximum image quality factor 0..100, ignored in default/lossless mode (defaults to 100)

jpegrecompress:

  • :allow_lossy — Allow worker, it is always lossy (defaults to false)
  • :quality — JPEG quality preset: 0 - low, 1 - medium, 2 - high, 3 - veryhigh (defaults to 3)
  • :method — Comparison Metric: mpe - Mean pixel error, ssim - Structural similarity, ms-ssim - Multi-scale structural similarity (slow!), smallfry - Linear-weighted BBCQ-like (may be patented) (defaults to ssim)

jpegtran:

  • :copy_chunks — Copy all chunks (defaults to false)
  • :progressive — Create progressive JPEG file (defaults to true)
  • :jpegrescan — Use jpegtran through jpegrescan, ignore progressive option (defaults to true)

optipng:

  • :level — Optimization level preset: 0 is least, 7 is best (defaults to 6)
  • :interlace — Interlace: true - interlace on, false - interlace off, nil - as is in original image (defaults to false)
  • :strip — Remove all auxiliary chunks (defaults to true)

oxipng:

  • :level — Optimization level preset: 0 is least, 6 is best (defaults to 3)
  • :interlace — Interlace: true - interlace on, false - interlace off, nil - as is in original image (defaults to false)
  • :strip — Remove all auxiliary chunks (defaults to true)

pngcrush:

  • :chunks — List of chunks to remove or :alla - all except tRNS/transparency or :allb - all except tRNS and gAMA/gamma (defaults to :alla)
  • :fix — Fix otherwise fatal conditions such as bad CRCs (defaults to false)
  • :brute — Brute force try all methods, very time-consuming and generally not worthwhile (defaults to false)
  • :blacken — Blacken fully transparent pixels (defaults to true)

pngout:

  • :copy_chunks — Copy optional chunks (defaults to false)
  • :strategy — Strategy: 0 - xtreme, 1 - intense, 2 - longest Match, 3 - huffman Only, 4 - uncompressed (defaults to 0)

pngquant:

  • :allow_lossy — Allow quality option (defaults to false)
  • :max_colors — Maximum number of colors to use (defaults to 256)
  • :quality — min..max - don't save below min, use less colors below max (both in range 0..100; in yaml - !ruby/range 0..100), ignored in default/lossless mode (defaults to 100..100, 0..100 in lossy mode)
  • :speed — speed/quality trade-off: 1 - slow, 3 - default, 11 - fast & rough (defaults to 3)

svgo:

  • :disable_plugins — List of plugins to disable (defaults to [])
  • :enable_plugins — List of plugins to enable (defaults to [])

Contributing

List of contributors to image_optim.

If you would like to contribute - that is great and you are very welcome. Please check few notes in file CONTRIBUTING.markdown.

ChangeLog

In separate file CHANGELOG.markdown.

Copyright

Copyright (c) 2012-2023 Ivan Kuchin. See LICENSE.txt for details.

image_optim's People

Contributors

abemedia avatar adammathys avatar brian-kephart avatar domoritz avatar fabiomcosta avatar gpakosz avatar iggant avatar janfoeh avatar jc00ke avatar jingoro avatar jwidderich avatar kares avatar kaspergrubbe avatar lencioni avatar lukaselmer avatar mrk21 avatar nybblr avatar oblakeerickson avatar oscillot avatar pftg avatar proinsias avatar ramiroaraujo avatar rawsyntax avatar reustle avatar schnittchen avatar tgxworld avatar tomhughes avatar toy avatar wjordan avatar yahonda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

image_optim's Issues

Optimized PNG looks a lot different

Running into a quirk where ImageOptim changes one of my PNGs during its optimization process. I don't fully understand why it's doing this.

I could ignore the specific file, but I actually do want it optimized. Just looking for some clues on what the problem is.

logo

Recursive directories via command line

Hey Ivan,

First thank you so much for your work on this.

Is there a way to target multiple directories or recurse through directories and compress all images within?

level parameter from CLI?

[feature request]

It would be great to be able to pass in a level param from the CLI interface... which normalized to each of the commands for controlling the level of optimization...

each command has their own levels, but you could offer an abstraction from 1-4 or something and have each of your options maps to something in the spectrum of the other command options.

`pngout` not found, linux

Image_optim v 0.11.1 causes:

rake aborted!
pngout not found

on a debian machine, all packages (advancecomp gifsicle jhead jpegoptim libjpeg-progs optipng pngcrush) are installed.

Integration with Rails asset pipeline as sprocket preprocessor

Check out this article :)

http://psionides.eu/2012/05/06/extending-asset-pipeline-with-custom-preprocessors/

class RootUrlPreprocessor < Sprockets::Processor
  def evaluate(context, locals)
    data.gsub(%r"\bHOSTNAME\b", "myserver.com")
  end
end

The context is an instance of Sprockets::Context; you can use it to e.g. read the current file’s path or content type, generate paths to asset files or access asset pipeline configuration. You also have access to several asset helpers from ActionView, like javascript_include_tag, image_tag etc.

http://rubydoc.info/gems/sprockets/2.0.3/Sprockets/Context

I think you would need fx content_type and somehow access the full path of the asset and run it through image_optim.

# in config/initializers/sprockets.rb
Rails.application.assets.register_preprocessor('application/javascript',
                                               RootUrlPreprocessor)

Just found an example here: https://github.com/botandrose/sprockets-image_compressor

Maybe you could join forces ;)

Sweet and simple! Yeah :)

Running recursively in an svn repo directory corrupts the repository

After running image_optim in -r recursive mode inside of a subversion directory, svn is unable to commit changes, failing with the error "Working copy text base is corrupt". Re-checking out the repository and running image_optim recursively using shell globbing instead doesn't have this issue (eg image_optim **/*.png)

In verbose mode with -r, you can see image_optim modifying files inside of the .svn directories, which is what is probably causing issues. A similar issue may exist for git repos (?)

Improve documentation

I'm having trouble matching the worker names to the tools that need to be installed (is advancecomp related to advpng?). The documentation could be clearer here.

Also, the worker names should all be spelled in the documentation to people can at least deactivate them. Probably even better a section for each, where additional options can be listet.

Keep up the good work! This gem solved a big problem for me.

Compressed files land in /tmp

I have a strange feeling that compressed files land in /tmp directory. I realised that after one of my rake tasks had been interrupted due to lack of space on a disc.

Command I run (for a large number of images, size around 50 GB):

image_optim = ImageOptim.new(:pngout => false, :pngcrush => false,
:optipng => { :level => 7 }, :advpng => false, :jpegoptim => { :strip => "all" },
:jpegtran => false)
logger = Logger.new("#{Rails.root}/log/image_optim.log")

image_optim.optimize_images!(images) do |unoptimized, optimized|
logger.info("#{Time.now} optimised image: #{unoptimized}") if optimized
end

Is it possible to avoid such behaviour or dump files to /dev/null, or delete them during procesing?

Optimize from raw image data, not a file

First, thanks for a great lib!

Sometimes in scripts, I already have the imagedata, maybe I've cut up thumbnails for a bigger image or whatever.

It would be nice to be able to optimize that imagedata Without having to first save it to a file so image_optim can read it.

Maybe a new method to not break the current API:
image_optim.optimize_image_data( image_data )

Can't detect file type without extension on pngs

Don't ask me why, but I'm working with a large set of user uploaded photos and they are all stored without the extension.

Since this photos are going to be served through the web, I'm testing some utils to compress those images.

When I call image_optim passing a png without extension, the program prints this output:

image_optim image
optimizing: ...... (elapsed: 0s)

However the above works if the image is actually a jpeg:

image_optim image
optimizing: 100.0% (elapsed: 0s)
46.03%  25.9K  image
Total: 46.03%  25.9K

Rails 4 compatibility

Config assets.compress is removed in Rails 4.

It is actually used here

I would propose to remove this check and only look on app.config.assets.image_optim value.

@toy , if you agree, I can try a PR for this.

Add global configuration from Ruby

Actually, the only way to set global config for image_optim is to write them in a .yml file.

For our Rails application, this is not really practical and we would like to make it possible to set them in an initializer or application config.

Does it seems like a useful feature ? If so, I can try to write a PR implementing this.

ImageOptim::BinNotFoundError: `jpegtran` not found

This error was appearing to me when I installed image_optim dependencies using the tutorial in the wiki:

ImageOptim::BinNotFoundError: `jpegtran` not found

The problem is that in Amazon AMI x86 64bits (The default image for Amazon EC2 instance) the binary jpegtran comes only in the libjpeg-turbo-utils package!

Here is my tutorial for installing the image_optim dependencies on Amazon EC2:

sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/advancecomp-1.15-12.el6.x86_64.rpm

sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/gifsicle-1.60-1.el6.x86_64.rpm

sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/jhead-2.90-2.el6.x86_64.rpm

sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/jpegoptim-1.3.0-1.el6.x86_64.rpm

sudo yum install -y libjpeg-turbo libjpeg-turbo-utils

sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/optipng-0.6.4-1.el6.x86_64.rpm

sudo yum install -y pngcrush

Cheers

parameter for binary path

Given I already downloaded the osx app, I have a dir with all the needed executables. It would be neat to be able to point image_optim there, instead of having to install them all over again.

JPEG marker not found error when using recursive

When attempting to use the recursive command line flags, I am receiving a generic JPEG marker not found error. This isn't happening in every use case, I believe it's only occurring when a corrupted JPEG is encountered.

EDIT: Upon further inspection, the JPEG does not appear to be corrupted. The header is 24bit N Exif IPTC ICC Adobe JFIF

SVG compression?

I serve a lot of SVG images in my designs for resolution independence (esp. logos and illustrations) and am manually compressing them with svgo.

It would be awesome to have this as another worker, has anybody already started an implementation? Any reasons against it?

Thanks!
~ Jonathan

Compass sprite support

I'm trying to use this on a site, and it works great for images I include in the repository. However, I also have a few sprites that are generated by compass (not checked in to the repo) and it's not optimizing those ones.

I'd be happy to help fix this, but I'm not sure where to start. If anyone can point me in the right direction that would be awesome!

PNG files getting "over-optimized" into gray blocks.

I'm using image_optim via middleman-imageoptim and when I run it with the following settings,

options.pngout_options    = {:copy_chunks => false, :strategy => 1}
options.pngcrush_options = {:chunks => :allb, :fix => false, :brute => false}
options.optipng_options   = {:level => 2, :interlace => nil}
options.advpng_options    = {:level => 2}
options.jpegoptim_options = {:strip => ['all'], :max_quality => 80}
options.jpegtran_options  = {:copy_chunks => false, :progressive => true, :jpegrescan => true}
options.gifsicle_options  = {:interlace => false}

and I'm having results that look like this.

logo_affiliate-amegy-bank-b983eb36

But the precompressed images look like this.

logo_affiliate-amegy-bank

I don't understand why they're getting compressed into gray blocks, is there something I'm missing about the optimization settings?

can't change access mode of IO object with zeus

io.optimize_image( dragonfly_file.tempfile )

.bundle/ruby/1.9.1/gems/image_optim-0.6.0/lib/image_optim/worker.rb:66:in `reopen': /dev/pts/6 can't change access mode from "r+" to "w" (ArgumentError)

using ruby 1.9.3 on ubuntu 12.04
using dragonfly
trying to follow this gist: https://gist.github.com/3320781
but running in rails console also does not work.
Not sure where to start looking into this error. help?

undefined method `inject' for nil:NilClass when using pngcrush

It seems like no matter which png I use, I keep receiving the same error. On Ruby 2.1.1 using rvm and Mac OS 10.9.2.

image_optim /Users/xxx/Desktop/png24-interlaced_skyline.png -v outputs...

verbose: true
Nice level: 10
Using threads: 4
optimizing: ......Resolved pngcrush 1.7.68
✓ 0.695815s pngcrush -rem alla -reduce -cc -q -- /Users/xxx/Desktop/png24-interlaced_skyline.png /var/folders/by/70n009td6jndv4p6b2t82m4r0000gp/T/png24-interlaced_skyline20140325-12551-16yakln.png
optimizing: ...... (elapsed: 1s)
undefined method 'inject for nil:NilClass
/Users/xxx/.rvm/gems/ruby-2.1.1/gems/image_optim-0.12.1/lib/image_optim/runner.rb:57:in 'run!'
/Users/xxx/.rvm/gems/ruby-2.1.1/gems/image_optim-0.12.1/lib/image_optim/runner.rb:68:in 'run!'
/Users/xxx/.rvm/gems/ruby-2.1.1/gems/image_optim-0.12.1/bin/image_optim:106:in '<top (required)>'
/Users/xxx/.rvm/gems/ruby-2.1.1/bin/image_optim:23:in 'load'
/Users/xxx/.rvm/gems/ruby-2.1.1/bin/image_optim:23:in '

'
/Users/xxx/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in 'eval'
/Users/xxx/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in ''

I've attached the image used in this example. Anyone else having a similar issue?

png24-interlaced_skyline

Add configuration file

It would be nice to be able to specify a configuration file with default options for image_optim.

For example in $HOME/.config/image_optim/settings.conf

no-threads = true
no-pngout = true
verbose = true

ImageOptim::BinNotFoundError: `jpegoptim` not found

Using a Dragonfly initializer with:

processor :optim do |content|
  io = ImageOptim.new(svgo: false)
  optimized = io.optimize_image(content.path)
  optimized.nil? ? content : optimized
end

Results in:

ImageOptim::BinNotFoundError: `jpegoptim` not found

Running jpegoptim in the terminal works fine.

Rails 4.1, Ruby 2.1.1, CentOS 6.5, jpegoptim 1.3.1

couldn't find HOME environment

Hey, great work with this gem, however I'm having an issue when deploying it in Production (Ubuntu 14.04). I'm getting:

lib/image_optim/config.rb:13:in `expand_path': couldn't find HOME environment -- expanding `~' (ArgumentError)

My user does have a home directory and when I run console, I get this:

irb(main):002:0> ENV["HOME"]
=> "/home/deployer"
irb(main):003:0> File.expand_path("~")
=> "/home/deployer"

Not sure what's happening.

Ignore Bin resolving errors programatically

I'm the author of a gem called spriteful that uses image_optim to optimize the sprites generated by my gem.

My idea is that spriteful should use any of the available workers in the developer machine, and instead of raising any exceptions it should just skip any missing worker. The problem is that ImageOptim.new will crash on any missing worker and the only way to avoid that is to do a pre-check of existing workers, which isn't very scalable as each new image_optim release that brings new workers requires me to update a list of workers on my side.

Do you think that we could have a way to avoid these failures and just let ImageOptim pick up the available workers? Something like passing a raise: false option comes to mind - Other alternative would be a static array of the available workers so I wouldn't have to maintain this list by myself.

Not as good as online compression tools

I've found jpegmini and tinypng to have better compression results and I'm curious to why that is? I figured these tools all used the same underlying compression libraries. I've tried amping up the image_optim settings, but don't see much difference.

Windows support

Would be really nice to have this in windows, all the binaries exist for windows in some form.
Currently I tried setting line 47 of bin_resolver.rb to true and now all I get is The system cannot find the path specified. with no traceroute or easy way to debug it.
It's probably because it can't find the .exe files even though they are in PATH and gems\image_optim-0.10.0\vendor.
Also bin_resolver.rb uses symlinks which are not supported in ruby on windows.

Maybe it's possible to extensively patch that one file and fix everything?
If not then I guess windows support may never happen, but I accept that. 😢

undefined method `register_preprocessor'

Since 11.1, I get this error when trying to start a rails app that includes this gem.

/Users/aaron/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/image_optim-0.11.1/lib/image_optim/railtie.rb:17:in block in <class:Railtie>': undefined methodregister_preprocessor' for nil:NilClass (NoMethodError)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.