views:

683

answers:

3

Hi,

Language Visual Basic 6.

I want to know if there is an open source or existing Microsoft Image library that will allow me to convert a GIF (8 Bit Depth) image to either one of the following: JPG, TIF.

I am currently using Imaging for Windows V2.7 API. I only found recently it does't support all the GIF type images.

I found that 99% of the GIF images get processed with no issue. Please note that the image is not broken and I am able to open it with a other imaging tool.

Thank you.

+1  A: 

ImageMagick is an excellent free open source image manipulation package. There is an OLE (ActiveX) control which you could use from VB6. I've never tried it myself - I always use the ImageMagick command line. I understand the control just takes the normal command lines anyway.

The conversion command for gif to jpg would be something like this.

convert my.gif my.jpg

EDIT: ImageMagick is licensed under the GPL: if you use the control and redistribute your program, it's possible your program would have to be free open-source. Apparently it's not yet been legally tested whether dynamic linking to a GPL library or control invokes the GPL. You could always launch the ImageMagick command-line which to me should be safe [I am not a lawyer].

MarkJ
If have found that the VB6 PictureBox saves a loaded image in a JPEG or BMP based on the extension. So what I did is to Load the image using PictureBox and save the image with .JPG extension.
Koekiebox
Yep, I guess that's easier!
MarkJ
@Koekiebox. Sorry, but once you load an image into a PictureBox control, SavePicture method will only save the picture as a BMP regardless of the extension. See my post on the way to do it.
AngryHacker
A: 

You might consider Windows® Image Acquisition Automation Library v2.0 Tool: Image acquisition and manipulation component for VB and scripting. There are plenty of examples of using it for image conversion, Google should turn up quite a few.

Bob Riemersma
It's only supported on Windows XP though.
MarkJ
+1  A: 

I've using this method using Intel's JPEG library. It will help you save your PictureBox as a JPEG. I am using this method in a production application and it works great.

AngryHacker
+1, if it's on VBAccelerator it must be good.
MarkJ