示例#1
0
        public ImageEntity(byte[] data)
        {
            Data = data ?? throw new ArgumentNullException(nameof(data));

            if (data.Length > 1024 * 1024)
            {
                throw new ArgumentException(nameof(data), "The image is too large! The max size is 1 MB.");
            }

            Preview = ImageConverter.FromImage(
                ImageWorker.GetSquarePreview(ImageConverter.ToImage(data), 100));
        }