Repeated call to convert (via COM) causes VB.net to crash!

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
NeilF

Repeated call to convert (via COM) causes VB.net to crash!

Post by NeilF »

I'm using the imagemagick object to batch convert images. If I call the CONVERT method after about 400-500 attempts the application starts lagging, before finally crashing/hanging.

If I replace the line by instead just doing a SHELL, then all is fine...

ie: Instead of this

Code: Select all

        ImageMagick.Convert(public_txtSourcePath + FileName, "-resize", "200x150", "-background", "black", "-gravity", "center", "-extent", "200x150", "-quality", "60", "-strip", public_txtThumbPath + FileName.ToLower)
Do this...

Code: Select all

        Dim command As String = "convert.exe """ + public_txtSourcePath + FileName + """ -resize 200x150 -background black -gravity center -extent 200x150 -quality 60 -strip """ + public_txtThumbPath + FileName.ToLower + """"
        Shell(command, AppWinStyle.Hide, True)
The call is being made from a threaded environment, but surely that can't be to blame?

It's like clockwork too! About 400-500 converts, and the CONVERT fails (via the COM).

And I've tried this on Vista64 and XP.
Post Reply