Skip to content

Commit

Permalink
Remove resize library to fix bug in png upscale
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpner committed May 20, 2015
1 parent 3b8a78d commit 5fa3ace
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
15 changes: 12 additions & 3 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions server/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"syscall"

"github.com/disintegration/imaging"
"github.com/nfnt/resize"
"gopkg.in/mgo.v2"
)

Expand Down Expand Up @@ -108,7 +107,7 @@ func ResizeImage(originalImageData image.Image, imageFormat string, entry *Entry
targetHeight = 0
}

dst = resize.Resize(uint(targetWidth), uint(targetHeight), originalImageData, resize.Lanczos3)
dst = imaging.Resize(originalImageData, int(targetWidth), int(targetHeight), imaging.Lanczos)
} else if entry.Type == TypeFit {
if targetWidth < 0 || targetHeight < 0 {
return nil, "", fmt.Errorf("When using type fit, both height and width must be specified")
Expand All @@ -122,7 +121,7 @@ func ResizeImage(originalImageData image.Image, imageFormat string, entry *Entry
targetWidth = targetHeight * originalRatio
}

dst = resize.Resize(uint(targetWidth), uint(targetHeight), originalImageData, resize.Lanczos3)
dst = imaging.Resize(originalImageData, int(targetWidth), int(targetHeight), imaging.Lanczos)
} else {
// typeCut
if targetWidth < 0 {
Expand Down
2 changes: 1 addition & 1 deletion server/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (s *ImageTestSuite) TestValidEntryTypeResizeAndFormatForwardingWidthMissing

c.Assert(imageFormat, Equals, "i do not care")
c.Assert(imageError, IsNil)
c.Assert((*imageData).Bounds().Dx(), Equals, 534)
c.Assert((*imageData).Bounds().Dx(), Equals, 533)
c.Assert((*imageData).Bounds().Dy(), Equals, 400)
}

Expand Down

0 comments on commit 5fa3ace

Please sign in to comment.