Permalink
Browse files

Merge pull request #2 from aybabtme/readme

Add README.
  • Loading branch information...
2 parents 6383d92 + 36ccded commit 31bae533263d19a59771942089baadcadf0237e6 @tobi committed Apr 20, 2014
Showing with 38 additions and 1 deletion.
  1. +37 −0 README.md
  2. +1 −1 image.go
View
@@ -0,0 +1,37 @@
+# package `mogrify`
+
+Package mogrify binds to `libgd` to perform transformations on
+images. It supports GIF/JPEG/PNG images, which it can decode and
+encode to. You can decode from a format and encode to another.
+
+The current set of transformations is limited to cropping, resizing
+and resampling.
+
+# Install
+
+You will need [`libgd`](http://libgd.bitbucket.org/) for the C bindings, then:
+
+```
+go get github.com/tobi/mogrify-go
+```
+
+# Docs?
+
+[Godocs](http://godoc.org/github.com/tobi/mogrify-go)!
+
+# Usage
+
+```go
+jpg, err := mogrify.DecodeJpeg(file)
+if err != nil { log.Fatalf(err) }
+defer jpg.Destroy()
+
+b := mogrify.Bounds{Width: 50, Height: 50}
+
+resized, err := jpg.NewResized(b)
+if err != nil { log.Fatalf(err) }
+defer resized.Destroy()
+
+_, _ := mogrify.EncodeGif(newfile, resized)
+if err != nil { log.Fatalf(err) }
+```
View
@@ -1,4 +1,4 @@
-// Package mogrify binds to GraphicMagicks to perform transformations on
+// Package mogrify binds to libgd to perform transformations on
// images. It supports GIF/JPEG/PNG images, which it can decode and
// encode to. You can decode from a format and encode to another.
//

0 comments on commit 31bae53

Please sign in to comment.