Start of images package and EXIF test files.

Change-Id: Ie623ddc7f6df5cbde890a7c0a47affe91780534b
This commit is contained in:
Brad Fitzpatrick 2012-11-04 16:16:02 +01:00
parent e783ad1717
commit a2e01c513b
17 changed files with 50 additions and 0 deletions

50
pkg/images/images.go Normal file
View File

@ -0,0 +1,50 @@
/*
Copyright 2012 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package images
import (
"image"
"io"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
)
type DecodeOpts struct {
// Rotate specifies how to rotate the image.
// If nil, the image is rotated automatically based on EXIF metadata.
// If an int, Rotate is the number of degrees to rotate
// counter clockwise and must be one of 0, 90, -90, 180, or
// -180.
Rotate interface{}
// MaxWidgth and MaxHeight optionally specify bounds on the
// final image's size.
MaxWidth, MaxHeight int
// TODO: consider alternate options if scaled ratio doesn't
// match original ratio:
// Crop bool
// Stretch bool
}
// Decode decodes an image from r using the provided decoding options.
// If opts is nil, the defaults are used.
func Decode(r io.Reader, opts *DecodeOpts) (image.Image, error) {
panic("TODO(mpl): implement")
}

BIN
pkg/images/testdata/f1-exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

BIN
pkg/images/testdata/f1.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

BIN
pkg/images/testdata/f2-exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

BIN
pkg/images/testdata/f2.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

BIN
pkg/images/testdata/f3-exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

BIN
pkg/images/testdata/f3.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

BIN
pkg/images/testdata/f4-exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

BIN
pkg/images/testdata/f4.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

BIN
pkg/images/testdata/f5-exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

BIN
pkg/images/testdata/f5.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

BIN
pkg/images/testdata/f6-exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

BIN
pkg/images/testdata/f6.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

BIN
pkg/images/testdata/f7-exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

BIN
pkg/images/testdata/f7.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

BIN
pkg/images/testdata/f8-exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

BIN
pkg/images/testdata/f8.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B