Skip to content

Commit 33cb910

Browse files
committed
Do not dispose objects manually
stream disposal causing input variable to be dispoed thus it cannot be chained - processed by other cmdlets
1 parent 825bc61 commit 33cb910

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

Photo.Shell/Photo.Shell.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
@{
33
RootModule = 'Photo.Shell.psm1'
4-
ModuleVersion = '1.0.0'
4+
ModuleVersion = '1.0.1'
55
GUID = '7c120cb8-77c1-47aa-a17d-51ce26a679ae'
66
Author = 'Alan Plocieniak'
77
CompanyName = 'Alan Plocieniak'

Photo.Shell/Public/Compress-Image.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ function Compress-Image {
4545
}
4646
$img = [System.Drawing.Image]::FromStream($stream)
4747
$img.Save($result, $codec, $parameters)
48-
$stream.Dispose()
4948
$result
5049
}
5150

Photo.Shell/Public/Resize-Image.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ function Resize-Image {
5050

5151
$graphics = [System.Drawing.Graphics]::FromImage($destImage)
5252
$graphics.DrawImage($img, 0, 0, $newWidth, $newHeight)
53-
$graphics.Dispose()
5453

5554
$stream2 = [System.IO.MemoryStream]::new()
5655
$destImage.Save($stream2, [System.Drawing.Imaging.ImageFormat]::Png)

0 commit comments

Comments
 (0)