This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Save PSD as jpeg

Hi

At the moment I am doing this:

Dim bmp As New Aurigma.GraphicsMill.Bitmap
bmp.Load(sPath & sFileName)

'Save image thumbnail
bmp.Transforms.Resize(75,75, Aurigma.GraphicsMill.Transforms.ResizeMode.Fit)
Dim sOutputFilename = sPath & "\thumbs\" & sFileName & ".jpg"
bmp.Save(sOutputFilename, New Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(75, False))
bmp.Dispose()
Response.End()

This works for all common graphics formats but not all psd files. For some PSD files it seems to generate an empty image.

Is there a different technique that always gets the flattened image from a PSD file?

Thanks

JG
Hello,

For PSD files I recommend you to use the following code:
Dim bitmap As New Aurigma.GraphicsMill.Bitmap
'Save image thumbnail
Dim sOutputFilename = "c:/testpsd1.jpg"
Dim reader As New Aurigma.GraphicsMill.Codecs.PsdReader("c:\Postcard01.psd")
Dim frame As Aurigma.GraphicsMill.Codecs.Frame = reader.LoadFrame(0)
frame.GetBitmap(bitmap)
bitmap.Transforms.Resize(75, 75, Aurigma.GraphicsMill.Transforms.ResizeMode.Fit)
bitmap.Save(sOutputFilename, New Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(75, False))
bitmap.Dispose()
Thanks for the reply.

I was wrong in fact the original code does produce a graphic. I was also trying to push the output to an outputstream and display on a page. It was this that did not produce an image.

Thanks again.