[Ssc-dev] It works!
Shawn Van Every
vanevery at walking-productions.com
Thu Apr 21 13:40:15 EDT 2011
Great! I'll checkout the latest version and give these examples a shot. I'll export the eclipse project and send it over so you can see how it is organized as well.
Talk soon
-- mobile shawn
Andrew Senior <aws at andrewsenior.com> wrote:
Also, I didn't point out that the latest version will return a set of "strips" in the redaction object. Those can be saved and used later for reversing the redaction. You can save them externally (e.g. in the database), or I can store them in the JPEG file somehow- either way they need to be encrypted. If they're being stored in the JPEG then I'll need a later call to pass in the encrypted info, or perhaps even better a callback [that I can call while redacting] so that I can write out the JPEG in one go.
Later if you pass back the same data (after decryption) I should be able to reverse the redaction, but haven't yet got this bit working.
Andrew
PS Perhaps these code snippets will make it clearer what I'm trying to say.
// Usage case 1: The encrypted redaction data is stored in the JPEG image somehow. Encryption is done with
// a callback
jpeg_redaction::Jpeg j2("/sdcard/windows.jpg", true);
jpeg_redaction::Redaction::Rect rect(50, 600, 50, 600);
jpeg_redaction::Redaction redaction;
redaction.AddRegion(rect);
EncryptionCallback the_encryption_callback(key)
j2.ParseImage(redaction, the_encryption_callback);
j2.Save("/sdcard/testoutput_with_redaction_data.jpg");
....
// Now restore the image
jpeg_redaction::Jpeg j2("/sdcard/testoutput_with_redaction_data.jpg", true);
DecryptionCallback the_decryption_callback(key)
j2.ReverseRedaction(the_decryption_callback);
j2.Save("/sdcard/unredacted.jpg");
// Usage case 2: data is stored in the database.
jpeg_redaction::Jpeg j2("/sdcard/windows.jpg", true);
jpeg_redaction::Redaction::Rect rect(50, 600, 50, 600);
jpeg_redaction::Redaction redaction;
redaction.AddRegion(rect);
j2.ParseImage(redaction);
j2.Save("/sdcard/testoutput.jpg");
database.SaveRedactionDataAfterEncryption(the_database_key, redaction)
// Now restore the image
jpeg_redaction::Jpeg j2("/sdcard/testoutput.jpg", true);
jpeg_redaction::Redaction redaction;
database.RetrieveRedactionDataAndDecrypt(the_database_key, redaction)
j2.ReverseRedaction(redaction);
j2.Save("/sdcard/unredacted.jpg");
On Wed, Apr 20, 2011 at 5:19 PM, Andrew Senior <aws at andrewsenior.com> wrote:
Hey, that's great. That looks like a sensible sequence.
The "rawgrey.pgm" is really a debugging thing- it returns the image that I get by decoding the intensity DC coefficients of each block, so ignoring colour, and giving an 8x8 downsampling.
You should be able to supply NULL to that parameter and it will be ignored.
However, since you're using "ParseImage", you're not using the latest version of the repository (now DecodeImage IIRC), so perhaps I didn't fix that check-for-null.
In practice it doesn't make sense to have this debugging parameter in there, so I'll get rid of it.
Let me know what things needed shifting around, and we can work out what the best way is, especially as I've checked in some changes since. Let me know your github ID and you can have write access.
Andrew
On Wed, Apr 20, 2011 at 12:56 PM, Shawn Van Every <vanevery at walking-productions.com> wrote:
Andrew,
I was able to get a simple example using your library working on Android!
Here is what I am running:
jpeg_redaction::Jpeg j2("/sdcard/windows.jpg", true);
jpeg_redaction::Redaction::Rect rect(50, 600, 50, 600);
jpeg_redaction::Redaction redaction;
redaction.AddRegion(rect);
j2.ParseImage(redaction, "/sdcard/rawgrey.pgm");
j2.Save("/sdcard/testoutput.jpg");
Does this make sense?
Specifically, I am wondering what the rawgrey.pgm file is for in the ParseImage function.
I had to do a bit a of moving things around to get it all to compile correctly for use on Android with the NDK so I am wondering if I should create another repo somewhere to house this or if we can check it in to your github repo?
-s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mayfirst.org/pipermail/ssc-dev/attachments/20110421/6b561cb6/attachment.htm>
More information about the Ssc-dev
mailing list