/// <summary>
        ///     Update parameters of existing PSD image, and upload updated image to Cloud Storage.
        /// </summary>
        public void ModifyPsdAndUploadToStorage()
        {
            Console.WriteLine("Update parameters of a PSD image and upload to cloud storage");

            UploadSampleImageToCloud();

            int?   channelsCount     = 3;
            var    compressionMethod = "raw";
            bool?  fromScratch       = null;
            var    folder            = CloudPath; // Input file is saved at the Examples folder in the storage
            string storage           = null;      // We are using default Cloud Storage

            var modifyPsdRequest =
                new ModifyPsdRequest(SampleImageFileName, channelsCount, compressionMethod, fromScratch, folder,
                                     storage);

            Console.WriteLine(
                $"Call ModifyPsd with params: channels count:{channelsCount}, compression method:{compressionMethod}");

            using (var updatedImage = ImagingApi.ModifyPsd(modifyPsdRequest))
            {
                UploadImageToCloud(GetModifiedSampleImageFileName(), updatedImage);
            }

            Console.WriteLine();
        }
        public void ModifyPsdTest()
        {
            string name              = "test.psd";
            int    channelsCount     = 3;
            string compressionMethod = "raw";
            bool?  fromScratch       = null;
            string folder            = TempFolder;
            string storage           = this.TestStorage;

            this.TestGetRequest(
                "ModifyPsdTest",
                $"Input image: {name}; Channel count: {channelsCount}; Compression method: {compressionMethod}",
                name,
                delegate
            {
                var request = new ModifyPsdRequest(name, channelsCount, compressionMethod, fromScratch,
                                                   folder, storage);
                return(ImagingApi.ModifyPsd(request));
            },
                delegate(ImagingResponse originalProperties, ImagingResponse resultProperties, Stream resultStream)
            {
                Assert.NotNull(resultProperties.PsdProperties);
                Assert.AreEqual(compressionMethod, resultProperties.PsdProperties.Compression.ToLower());
                Assert.AreEqual(channelsCount, resultProperties.PsdProperties.ChannelsCount);

                Assert.NotNull(originalProperties.PsdProperties);
                Assert.AreEqual(originalProperties.Width, resultProperties.Width);
                Assert.AreEqual(originalProperties.Height, resultProperties.Height);
                Assert.AreEqual(originalProperties.PsdProperties.BitsPerChannel, resultProperties.PsdProperties.BitsPerChannel);
            },
                folder,
                storage);
        }