Forum Moderators: coopster

Message Too Old, No Replies

Using PHP to convert Picture from MSAccess to MSSQL

Stored as EMF in Access, but I need JPG

         

Duskrider

8:55 pm on Jun 18, 2007 (gmt 0)

10+ Year Member



The whole process here is a little strange, but I'll try to keep it simple. My company has an Access database for the human resources department, and I've been tasked with porting it over to MSSQL and adding a web based system for HR to use. The Access and MSSQL databases are pretty close, but some functionality has been added and some taken away... so they aren't identical. I'm in the process of writing the code that will do the transfer (validating old values and defaulting new ones, etc)

Also, the information I'm converting is actually coming from a MSSQL database that is a copy of the Access database. Due to permissions, I couldn't create an ODBC for the Access DB, so I had to import it into MSSQL... so that's where my data is coming from at this point. The picture information copied right across.

My problem is that the picture files in the Access database were stored as "Microsoft Word Pictures" and I need to convert them over to .jpg images for the new database. The new system won't store the picture, just the link to it... so I need to actually create the image from the information in Access.

With all the database stuff, this is in the PHP forum because I'm using php to do it all. I can output the raw string for the image to the browser, but haven't been able to get the picture to show. Does anyone know a way, in php, to convert a Microsoft Word Picture(EMF) to jpg? I've looked it up and am coming up blank.

coopster

4:22 am on Jun 19, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Load the open source project Imagemagick [imagemagick.org] on your Windows box and you should be able to do the conversions.