Skip to content

Commit

Permalink
Add noop operation
Browse files Browse the repository at this point in the history
  • Loading branch information
thoas committed Aug 16, 2016
1 parent 886fc3f commit 844e222
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changes
=======

0.5.0
-----

...

0.4.0
-----

Expand Down
4 changes: 4 additions & 0 deletions engine/goimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ func (e *GoImageEngine) Transform(img *imagefile.ImageFile, operation *Operation
}

switch operation {
case Noop:
file.Processed = file.Source

return file, err
case Flip:
pos, ok := qs["pos"]

Expand Down
5 changes: 5 additions & 0 deletions engine/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ var Fit = &Operation{
"fit",
}

var Noop = &Operation{
"noop",
}

var Operations = map[string]*Operation{
Resize.Name: Resize,
Thumbnail.Name: Thumbnail,
Flip.Name: Flip,
Rotate.Name: Rotate,
Fit.Name: Fit,
Noop.Name: Noop,
}

0 comments on commit 844e222

Please sign in to comment.