skia2/tests/ExifTest.cpp
Hal Canary c465d13e6f resources: orgainize directory.
Should make it easier to ask just for images.

Change-Id: If821743dc924c4bfbc6b2b2d29b14affde7b3afd
Reviewed-on: https://skia-review.googlesource.com/82684
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-12-08 17:16:00 +00:00

29 lines
879 B
C++

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Resources.h"
#include "SkCodec.h"
#include "Test.h"
DEF_TEST(ExifOrientation, r) {
std::unique_ptr<SkStream> stream(GetResourceAsStream("images/exif-orientation-2-ur.jpg"));
REPORTER_ASSERT(r, nullptr != stream);
if (!stream) {
return;
}
std::unique_ptr<SkCodec> codec(SkCodec::MakeFromStream(std::move(stream)));
REPORTER_ASSERT(r, nullptr != codec);
SkEncodedOrigin origin = codec->getOrigin();
REPORTER_ASSERT(r, kTopRight_SkEncodedOrigin == origin);
codec = SkCodec::MakeFromStream(GetResourceAsStream("images/mandrill_512_q075.jpg"));
REPORTER_ASSERT(r, nullptr != codec);
origin = codec->getOrigin();
REPORTER_ASSERT(r, kTopLeft_SkEncodedOrigin == origin);
}