Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Writing to an already open stream?

$
0
0
I have a possible issue when writing to an open stream. My code works like this:
  1. Open a file stream called destinationStream:
  2. create MagickImage object
  3. call object.Write(destinationStream) which works fine
  4. create MagickImage object2
  5. call object2.Merge() to add a watermark
  6. call object2.Write(destinationStream) which seems to work fine
  7. dispose of destinationStream
The resulting file is an image that is twice the size(2MB) that it should be and the image does not have the watermark. If I dispose of the destinationStream between the two write calls, and then reopen the stream everything works fine. Also, the file size is 1MB, not 2MB.

Is it possible that Magick requires my file stream to be closed/reopened between writes to produce the desired effect? And if you think this is simply a C# file stream thing, then disregard.

Thanks

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>