13 July 2015

Web app with image uploader

Delegates

Download from delegates, decompress and install codecs libs (maybe there are new versions)

tar -xvf jpegsrc.v9a.tar.gz 
tar -xvf libpng-1.6.16.tar.gz
cd jpeg-9a/
./configure
make
make test
sudo make install

cd ../libpng-1.6.16/
./configure
make
make test
sudo make install

ImageMagick

Download the latest version, decompress and install ImageMagick http://mirror.checkdomain.de/imagemagick/

tar xvfz ImageMagick-6.9.1-2.tar.gz
cd ImageMagick-6.9.1-2
./configure '--with-png=yes' '--with-jpeg=yes' '--with-jp2=yes' '--with-freetype=yes'
make
sudo make install
sudo ldconfig /usr/local/lib
/usr/local/bin/convert logo: logo.gif
make check
identify -list configure

Configuration

Follow the gems documentation.

# /config/minimagick.rb
MiniMagick.configure do |config|
  config.whiny = false
end

Recreate versions

Product.all.each do |product|
  product.photos.each do |photo|
    photo.recreate_versions!
  end
end

Nginx Error - 413 Request Entity Too Large

# /etc/nginx/nginx.conf
server {
      client_max_body_size 20M;
      listen       80;