Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Move away from VIPS for bimg
Browse files Browse the repository at this point in the history
We noticed that our images are being rotated in sherlock.

It seems that this is happening in gothumb (we have the original in the correct orientation)

Rather than try and work this out I found this issue. DAddYE/vips#37

What is concerning is that from the README

> When generating JPEG output all metadata is removed and Huffman tables optimised without having to use separate command line tools like jpegoptim and jpegtran.

I'm guessing at Go a bit so there's likely some unwanted changes in this :(
  • Loading branch information
hassox authored and Skylar Lee committed Sep 26, 2017
1 parent 4b74f61 commit 6248665
Show file tree
Hide file tree
Showing 22 changed files with 3,240 additions and 9 deletions.
12 changes: 8 additions & 4 deletions Godeps/Godeps.json

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

2 changes: 1 addition & 1 deletion bin/install
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

brew install --devel go
brew install go
brew tap homebrew/science
brew install vips
if [ -z $GOPATH ]; then
Expand Down
9 changes: 5 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"strings"
"time"

"github.com/DAddYE/vips"
"github.com/julienschmidt/httprouter"
"github.com/rlmcpherson/s3gof3r"
"gopkg.in/h2non/bimg.v1"
)

var (
Expand Down Expand Up @@ -200,14 +200,15 @@ func generateThumbnail(w http.ResponseWriter, rmethod, rpath string, sourceURL s
return
}

buf, err := vips.Resize(img, vips.Options{
buf, err := bimg.Resize(img, bimg.Options{
Height: int(height),
Width: int(width),
Gravity: bimg.GravityCentre,
Crop: true,
Interpolator: vips.BICUBIC,
Gravity: vips.CENTRE,
Interpolator: bimg.Bicubic,
Quality: 50,
})

if err != nil {
responseCode := 500
if err.Error() == "unknown image format" {
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/tj/go-debug/History.md

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

8 changes: 8 additions & 0 deletions vendor/github.com/tj/go-debug/Makefile

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

75 changes: 75 additions & 0 deletions vendor/github.com/tj/go-debug/Readme.md

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

128 changes: 128 additions & 0 deletions vendor/github.com/tj/go-debug/debug.go

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

12 changes: 12 additions & 0 deletions vendor/gopkg.in/h2non/bimg.v1/.editorconfig

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

8 changes: 8 additions & 0 deletions vendor/gopkg.in/h2non/bimg.v1/.gitignore

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

Loading

0 comments on commit 6248665

Please sign in to comment.