public async ValueTask <(bool succeed, Error error, ImageResult result)> CreateIamgeResourceAsync(byte[] base64Image) { var unq_name = $"{Guid.NewGuid().ToString()}-{DateTime.UtcNow.ToUnix()}"; var end = new ImageResult(); try { var error = default(string); (end.OriginImagePath, error) = await CreateImageByCompressPercentAsync(base64Image, unq_name, origin, 0.5); if (string.IsNullOrEmpty(end.OriginImagePath)) { return(false, Error.Create(Errors.CompressFileFailed, error), null); } (end.ThumbnailPath, error) = await CreateImageByCompressPercentAsync(base64Image, unq_name, thumbnail, 0.1, true); if (string.IsNullOrEmpty(end.ThumbnailPath)) { return(false, Error.Create(Errors.CompressFileFailed, error), null); } (end.Width, end.Height) = ImageCompressor.BinarySize(base64Image); } catch (Exception e) { return(false, Error.Create(Errors.CreateFileFailed, e.Message), null); } return(true, Error.Empty, end); }