Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Script makes "virtually lossless" compression of Woodwing's Digital Magazine Tools images folder.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.rdoc

ImageSqueezer

Intro

Woodwing's Digital Magazine Tools (www.woodwing.com/en/digital-magazine/ipad-now) are great to create magazines for tablet devices. Unfortunately the images used to display the magazine could be much smaller and still shown in good quality.

The ImageSqueezer-Script takes care of this problem by doing the following changes in /magazine/images/story_* :

  1. It looks for JPGs and adjusts their compression if needed.

  2. It looks for PNGs having no transparency. It converts those PNGs to JPGs and adjusts the compression on those JPGs.

With the default values of the script it should be possible to reduce the size of your magazine of ~30%.

NOTE: I WON'T PROVIDE ANY SUPPORT ON INSTALLING AND RUNNING THIS SCRIPT: RTFM! :) FEEL FREE TO READ THIS DOCUMENT AND THE DOCUMENTED CODE IN THE SCRIPT TO UNDERSTAND HOW IT WORKS.

Installation Requirements

This “ingredients” need to be installed and working for the script to run correctly. You'll find instructions on how to install them on the websites mentioned above. Please use RubyGems to install Nokogiri and RMagick if you don't know exactly what you're doing.

Installation

  1. Download imagesqueezer.rb from Github (github.com/vazqujav/ImageSqueezer)

  2. Put the file imagesqueezer.rb somewhere you will find it again ;-)

  3. Done

Usage

ruby imagesqueezer.rb [options] <directory>

In words: Run the script and give the magazine directory as argument. The script expects a file named 'magazine.xml' and a folder named 'images' inside the magazine directory. Besides that it expects PNG paths to be in an XML node (in magazine.xml) named 'url'.

Example

ruby imagesqueezer.rb magazine/

This would recursively parse '/magazine/images/story_*' and apply itself to all JPGs and non-transparent PNGs.

FAQ

How can I change the compression quality? Look for the constants PNG_COMPRESSION and JPG_COMPRESSION in the script. By changing them you're able to tweak the compression.

Author

javier.vazquez@ringier.ch

Copyright

Copyright 2011 Ringier AG, Javier Vazquez

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Something went wrong with that request. Please try again.