Skip to content

Commit

Permalink
overwrite orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
Idan Yael committed Dec 16, 2019
1 parent f97ee1a commit 4268fb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions vips/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ type ImageRef struct {
}

type ImageMetadata struct {
Format ImageType
Width int
Height int
Format ImageType
Width int
Height int
Colorspace Interpretation
Orientation int
}

// ExportParams are options when exporting an image to file or buffer
Expand Down Expand Up @@ -229,9 +231,11 @@ func (r *ImageRef) Export(params *ExportParams) ([]byte, *ImageMetadata, error)
}

metadata := &ImageMetadata{
Format: format,
Width: r.Width(),
Height: r.Height(),
Format: format,
Width: r.Width(),
Height: r.Height(),
Colorspace: r.ColorSpace(),
Orientation: r.GetOrientation(),
}

return buf, metadata, nil
Expand Down
2 changes: 1 addition & 1 deletion vips/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ func (b *blackboard) postProcess() error {
}
}

if b.OverwriteOrientation > 1 {
if b.OverwriteOrientation > 0 {
b.image.SetOrientation(b.OverwriteOrientation)
}

Expand Down

0 comments on commit 4268fb3

Please sign in to comment.