Can I Use a Binary Stream as input for IM.convert?

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

Can I Use a Binary Stream as input for IM.convert?

Post by brainlord »

I have a two-step conversion process for a proprietary bitmap format.

1st, I open this proprietary bitmap in VB as a binary stream, where I screw with that stream and turn it into an almost-readable Mac PICT file which I save to the HD.

Then I use IMObject.convert to further process that intermediate PICT and save its a cross-platform PNG. This all works.

But do I HAVE to *save* the PICT first?

I have the PICT data as Binary Stream IN MEMORY already, seems like a total waste of time to write that to the HD, then immediately read it off the HD (in IM) and then delete it. (These are actually three consecutive lines in the same sub.)

Is there any way to have IMObject read the stream from memory?

BTW: Thanks guys for making IM! its the fourth imaging DLL I've tried in the past week. And it was ONLY one that worked.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Can I Use a Binary Stream as input for IM.convert?

Post by magick »

The ImageMagick Windows source distribution has an ArrayTest.vbs source file that shows how to handle in-memory images (blobs). You might also look at the ImageMagick .Net wrapper, see http://www.imagemagick.org/script/api.php.
jcasique

Re: Can I Use a Binary Stream as input for IM.convert?

Post by jcasique »

Hi, do you get the solution.

I'm trying to convert image from memory stream usinsg ImageMagick and I got this error:

"convert: 400: Perform: Unsupported argument type"

I'm using VB.Net 2005 and ImageMagick 6.4.3 Q16

Thank you in advance
brainlord

Re: Can I Use a Binary Stream as input for IM.convert?

Post by brainlord »

the bad news:

1. ArrayTest.vbs is an example of THREE THINGS AT ONCE. and as such is not really an example of any ONE thing for a newbie . :(

2. I don't have a BLOB (a Binary Long OBject) I have an ADO stream containing binary data. I'm pretty sure you can convert a Binary Stream into a blob but I don't know how.

3. the ArrayTest example puts data into the array (not a stream) to identify the source format, but if I put any other data into my stream I screw up what is otherwise a readable PICT file.

the good news:
the null: parameter may be what i'm looking for if I can figure out the right syntax:

This DOESN'T work:
objMagImage.convert "null:", "PICT:", PICTByte, strPNGPath

where PICTByte is my data stream

I'm still writing a file, reading it and then throwing it away
MoBO

Re: Can I Use a Binary Stream as input for IM.convert?

Post by MoBO »

I agree, a good sample for VB.NET is missing.

Do anybody has been able to work with Binary Stream ??????
I'm able to work with "physical" images but need more to goes on.

Please HELP :?
MoBO

Re: Can I Use a Binary Stream as input for IM.convert?

Post by MoBO »

It's very strange to be unable to find real VB.NET or Express 2008 sample on the web about this feature.
To be honest, difficult to have anything related to ImageMagick & VB.

Is there anybody able to share a small part of a code or at least provide VB.NET sample ?

Once again... I'm begging :?
MoBO

Re: Can I Use a Binary Stream as input for IM.convert?

Post by MoBO »

Just a litte "up" :(
Werty
Posts: 66
Joined: 2010-08-06T05:37:36-07:00
Authentication code: 8675308

Re: Can I Use a Binary Stream as input for IM.convert?

Post by Werty »

Bumping also.

We REALLY need a SIMPLE example on how to use blobs, and not just something that outputs a 1x1 pixel image :p
Windows 7 user
Post Reply