Hi Harlo, <br>I just pushed a new version of JpegRedactionLibrary to github which can take all the redaction region information, including the info needed to unredact those regions, and pack it up into a <br>binary blob. If given a binary blob of such data it can unpack it and reverse the redaction.  This is still limited to blobs < 64KB, but shows you how it could work. <br>

Let me know if this is useful, or you need something different. I hope to get rid of the size limit in the next day or two. <br><br>See the example code at: <br><a href="https://github.com/asenior/Jpeg-Redaction-Library/blob/master/test/metadatatest.cpp#L77">https://github.com/asenior/Jpeg-Redaction-Library/blob/master/test/metadatatest.cpp#L77</a><br>

<br>it redacts an image "original" and the redaction data in redaction is packed into a blob redaction_pack, which is then stored in the image and saved.<br><div style="background-color:transparent" class="line" id="LC91">

      <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">unsigned</span> <span class="kt">char</span><span class="o">></span> <span class="n">redaction_pack</span><span class="p">;</span></div>

<div style="background-color:transparent" class="line" id="LC92">      <span class="n">redaction</span><span class="p">.</span><span class="n">Pack</span><span class="p">(</span><span class="o">&</span><span class="n">redaction_pack</span><span class="p">);</span></div>

<div style="background-color:transparent" class="line" id="LC93">      <span class="n">printf</span><span class="p">(</span><span class="s">"Packed redaction object is %d bytes</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">redaction_pack</span><span class="p">.</span><span class="n">size</span><span class="p">());</span></div>

<div style="background-color:transparent" class="line" id="LC94">      <span class="n">original</span><span class="p">.</span><span class="n">SetObscuraMetaData</span><span class="p">(</span><span class="n">redaction_pack</span><span class="p">.</span><span class="n">size</span><span class="p">(),</span></div>

<div style="background-color:transparent" class="line" id="LC95">                             <span class="o">&</span><span class="n">redaction_pack</span><span class="p">.</span><span class="n">front</span><span class="p">());</span></div>

<br>later on that process is reversed and the image is restored. As I understand it you want to get the redaction_pack & encrypt it then add your own metadata before passing it back as "ObscuraMetaData". <br>

<br>there's also this sample code<br><a href="https://github.com/asenior/Jpeg-Redaction-Library/blob/master/test/test_utils.cpp#L162">https://github.com/asenior/Jpeg-Redaction-Library/blob/master/test/test_utils.cpp#L162</a><br>

called from here:<br><a href="https://github.com/asenior/Jpeg-Redaction-Library/blob/master/test/test_redaction.cpp#L39">https://github.com/asenior/Jpeg-Redaction-Library/blob/master/test/test_redaction.cpp#L39</a><br>that does the same operation without the intermediate save to disk.<br>

<br>Andrew<br>