<commit_before>cfs-graphicsmagick
=========================

NOTE: This branch is under active development right now (2013-11-18). It has
bugs and the API may continue to change. Please help test it and fix bugs,
but don't use in production yet.

A Meteor package that adds simple image manipulation using GraphicsMagick for
[CollectionFS](https://github.com/CollectionFS/Meteor-CollectionFS). The main
purpose of this is to quickly and easily check and manipulate images
in the `beforeSave` function for a CollectionFS master file or copy.

## Prerequisites

Install the latest release of `imagemagick` and `graphicsmagick` on your
development machine and on any servers on which your app will be hosted.

## Installation

Install using Meteorite. When in a Meteorite-managed app directory, enter:

```
$ mrt add cfs-graphicsmagick
```

## Usage

```js
var fo = new FileObject(fileRecord);
fo.gm().anyGMFunction().save();
```

Calling `myFileObject.gm()` gets you a GraphicsMagick context and then calling
`save()` at the end of your chain saves all of the changes back into the
FileObject buffer.

[See all the fun things you can do!](http://aheckmann.github.io/gm/docs.html)

## Example

Here's how to resize an image prior to saving it using a CollectionFS
`beforeSave` function:

```js<commit_msg>add correct temporary installation instructions<commit_after>cfs-graphicsmagick
=========================

NOTE: This branch is under active development right now (2013-11-18). It has
bugs and the API may continue to change. Please help test it and fix bugs,
but don't use in production yet.

A Meteor package that adds simple image manipulation using GraphicsMagick for
[CollectionFS](https://github.com/CollectionFS/Meteor-CollectionFS). The main
purpose of this is to quickly and easily check and manipulate images
in the `beforeSave` function for a CollectionFS master file or copy.

## Prerequisites

Install the latest release of `imagemagick` and `graphicsmagick` on your
development machine and on any servers on which your app will be hosted.

## Installation

NOTE: Until this is added to atmosphere, use this in smart.json:

```js
"cfs-graphicsmagick": {
  "git": "https://github.com/CollectionFS/Meteor-cfs-graphicsmagick.git",
  "branch": "master"
}
```

Install using Meteorite. When in a Meteorite-managed app directory, enter:

```
$ mrt add cfs-graphicsmagick
```

## Usage

```js
var fo = new FileObject(fileRecord);
fo.gm().anyGMFunction().save();
```

Calling `myFileObject.gm()` gets you a GraphicsMagick context and then calling
`save()` at the end of your chain saves all of the changes back into the
FileObject buffer.

[See all the fun things you can do!](http://aheckmann.github.io/gm/docs.html)

## Example

Here's how to resize an image prior to saving it using a CollectionFS
`beforeSave` function:

```js
{'fraction_non_alphanumeric': 0.10366713681241185, 'fraction_numerical': 0.005641748942172073, 'mean_word_length': 4.873706004140787, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4381040', 'n_tokens_mistral': 854, 'n_tokens_neox': 783, 'n_words': 356}