1 /* 2 * Copyright 2016 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #include "Resources.h" 9 #include "SkCodec.h" 10 #include "Test.h" 11 12 DEF_TEST(ExifOrientation, r) { 13 std::unique_ptr<SkStream> stream(GetResourceAsStream("images/exif-orientation-2-ur.jpg")); 14 REPORTER_ASSERT(r, nullptr != stream); 15 if (!stream) { 16 return; 17 } 18 19 std::unique_ptr<SkCodec> codec(SkCodec::MakeFromStream(std::move(stream))); 20 REPORTER_ASSERT(r, nullptr != codec); 21 SkEncodedOrigin origin = codec->getOrigin(); 22 REPORTER_ASSERT(r, kTopRight_SkEncodedOrigin == origin); 23 24 codec = SkCodec::MakeFromStream(GetResourceAsStream("images/mandrill_512_q075.jpg")); 25 REPORTER_ASSERT(r, nullptr != codec); 26 origin = codec->getOrigin(); 27 REPORTER_ASSERT(r, kTopLeft_SkEncodedOrigin == origin); 28 } 29