Creating/reusing wands and images
Posted: 2014-12-08T10:53:16-07:00
Hi all, I'm just starting to use MagickWand's C API. I'm using it for testing some low-level pixel-level operations. I use MagickWand to open a file, I export the pixels into my own malloc'd array, mess around with it a bit and import the array back into the same image and wand. Then when I write the wand's image back to a new file, it's segfaulting on me in a malloc.
I'm not really asking for advice on that problem, for one thing I don't have the details to hand, but I see from el_supremo's useful examples that he uses multiple images per wand, and multiple wands. So the question I have at this stage, because I haven't seen it discussed anywhere, is: When should/must you create new images or wands, and when can you reuse them. Maybe it's simply not valid to change an exported pixel array and import it back?
Sorry for vagueness at this stage, don't have the details to hand but will respond to any requests for more detail.
I'm not really asking for advice on that problem, for one thing I don't have the details to hand, but I see from el_supremo's useful examples that he uses multiple images per wand, and multiple wands. So the question I have at this stage, because I haven't seen it discussed anywhere, is: When should/must you create new images or wands, and when can you reuse them. Maybe it's simply not valid to change an exported pixel array and import it back?
Sorry for vagueness at this stage, don't have the details to hand but will respond to any requests for more detail.