Two problems with Export-Bitmap

Topics: Developer Forum, User Forum
Mar 7, 2008 at 3:05 PM
I have two problems with Export-Bitmap in version 1.1.1. The first problem:

> $img = Import-Bitmap picture.jpg
> Export-Bitmap $img file.jpg jpeg 100
Export-Bitmap : A generic error occurred in GDI+.
At line:1 char:14
+ Export-Bitmap <<<< $img file.jpg jpeg 100

This creates a 0 length file named file.jpeg. Which is the second problem. Export-Bitmap ignores the file extension I give the output file and uses "jpeg" instead of "jpg".

The image looks correct:

> $img


Tag :
PhysicalDimension : {Width=320, Height=530}
Size : {Width=320, Height=530}
Width : 320
Height : 530
HorizontalResolution : 90
VerticalResolution : 90
Flags : 77960
RawFormat : ImageFormat: b96b3cae-0728-11d3-9d7b-0000f81ef32e
PixelFormat : Format24bppRgb
Palette : System.Drawing.Imaging.ColorPalette
FrameDimensionsList : {7462dc86-6180-4c7e-8e3f-ee7333a7a483}
PropertyIdList :
PropertyItems :

And I can even resize if with Resize-Bitmap.

Details:

Windows Vista SP1 x64. The problem occurs also when running PowerShell (X86).

Any ideas?
Developer
Mar 7, 2008 at 6:46 PM
I've got an repro of this on W2K3. I'll turn it into a workitem.
Developer
Mar 7, 2008 at 6:47 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.