Convert TIFF to JPEG Extension Issue
Posted on 2010-11-16
I'm trying to use a SSIS 2008 package to go to a file share folder, retrieve all the files which will be in the Tiff format, and save them to another location (on the same server) so web users can have web access to them. The catch is these pictures need to be saved as a gif or jpeg (what are some thoughts on .png?).
I have the below code that is in a SSIS script task. The SSIS package works, with no errors; however, it saves the tiff files as a Tiff file. If i use an .aspx environment (I find this easier to test), the files are transfered to the correct folder, however, they don't have an extension (no .jpeg, .tiff, etc.)
I developed this code on my computer and it works flawlessly, however, once I put it on the production server, this issue started to show up. The production server doesn't recognize the jpeg or gif format, could this have something to do with it?
Public Sub Main()
Dim StoreFile As Directory
Dim Directory As String
Dim Files As String()
Dim File As String
Dim bm As Bitmap
'Asign Save as Location
Directory = "C:\xx\xx\website\Folder\ChartImages\"
'Asign the files to variable
Files = StoreFile.GetFiles("X:\x")
'Loops through the files
For Each File In Files
bm = Bitmap.FromFile(File)
bm.Save(Directory & System.IO.Path.GetFileName(File) & "", Jpeg)