Skip to content

Commit

Permalink
auto apply orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
takutakahashi committed Feb 20, 2024
1 parent 6a7aebb commit 15f3f16
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package main

import (
"bytes"
"image"
"image/jpeg"
"io"

"github.com/disintegration/imaging"
)

func convert(src io.Reader, q int) (*bytes.Buffer, error) {
img, _, err := image.Decode(src)
img, err := imaging.Decode(src, imaging.AutoOrientation(true))
if err != nil {
return nil, err
}
Expand Down
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module github.com/pepabo/oyaki

go 1.19

require github.com/disintegration/imaging v1.6.2

require golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 // indirect
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 h1:hVwzHzIUGRjiF7EcUjqNxk3NCfkPxbDKRdnNE1Rpg0U=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

0 comments on commit 15f3f16

Please sign in to comment.