Ejemplo n.º 1
0
        public void TestGetImageInfo()
        {
            var imageBytes = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlPM0jRW/QAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=");

            using (var c = new JobContext())
            {
                c.AddInputBytes(0, imageBytes);
                var result = c.GetImageInfo(0);

                Assert.Equal(result.ImageWidth, 1);
                Assert.Equal(result.ImageHeight, 1);
                Assert.Equal(result.PreferredExtension, "png");
                Assert.Equal(result.PreferredMimeType, "image/png");
                Assert.Equal(result.FrameDecodesInto, PixelFormat.Bgra_32);
            }
        }