refactor(#47): minor refactors, code normalization and test coverage

This commit is contained in:
Tomas Aparicio 2015-07-11 16:50:25 +01:00
parent 6edd96ee41
commit ed4faadba6
10 changed files with 309 additions and 92 deletions

View file

@ -117,15 +117,15 @@ func Resize(buf []byte, o Options) ([]byte, error) {
}
saveOptions := vipsSaveOptions{
Quality: o.Quality,
Type: o.Type,
Compression: o.Compression,
Interlace: o.Interlace,
NoProfile: o.NoProfile,
Quality: o.Quality,
Type: o.Type,
Compression: o.Compression,
Interlace: o.Interlace,
NoProfile: o.NoProfile,
Interpretation: o.Interpretation,
}
// Finally save as buffer
// Finally get the resultant buffer
buf, err = vipsSave(image, saveOptions)
if err != nil {
return nil, err
@ -145,7 +145,7 @@ func applyDefaults(o *Options, imageType ImageType) {
o.Type = imageType
}
if o.Interpretation == 0 {
o.Interpretation = sRGB
o.Interpretation = INTERPRETATION_sRGB
}
}