SSIS to extract photos in correct jpg format

  • The job is to extract the photos from the SQL table into .jpg format.

    I have created an SSIS package and used an Export column to extract the photos. I used a derived column to give the extention as .jpg

    Apparently , even though the photos are being extracted with an extension of .jpg , its actually not .jpg but .bmp.

    Any idea how we extract the photos in valid .jpg format ?

  • Was the binary data uploaded as a jpg or a bmp?

  • I am afraid I dont know .. thats the legacy data ..

  • Well more than likely was inserted as BMP, so you would need to extract them and convert them in a picture editor and re-upload them to the DB.

  • Yeah agree.. but imagine if we have almost 500K pictures to convert .. What would be the best approach then ?

  • cant help you on that, thought it would have to be manually 1 by 1 as you will need to open the files and save them as jpg then re-upload

  • You'd have to either:

    1) Use a script transformation task (this is just pure .Net code), then just use one of the examples of converting a bmp file to a jpg in code

    2) Save them as a .bmp, then shell out to a command line utility to do the same thing

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply