Exemplo n.º 1
0
        public PictureData(PictureDataContract contract)
        {
            ParamIs.NotNull(() => contract);

            Bytes = contract.Bytes;
            Mime = contract.Mime;

            if (contract.Thumb250 != null)
                Thumb250 = new PictureThumb250(contract.Thumb250);
        }
Exemplo n.º 2
0
        public static PictureDataContract GetOriginalAndResizedImages(Stream input, int length, string contentType)
        {
            var buf = new Byte[length];
            input.Read(buf, 0, length);

            var contract = new PictureDataContract(buf, contentType);
            var thumbs = GenerateThumbs(input, new[] { 250 });
            var thumb250 = thumbs.FirstOrDefault(t => t.Size == 250);

            contract.Thumb250 = thumb250;

            return contract;
        }