Skip to content

Commit

Permalink
updated watermark embedding (only sift and blind)
Browse files Browse the repository at this point in the history
  • Loading branch information
majortomts committed Feb 18, 2024
1 parent d1f090a commit 2fdd644
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion application/Model/Run.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function uploadFiles($files) {

if($fileSaved) {
// generate watermark version of image via python script if enabled in settings
if (($mime === 'image/jpeg' || $mime === 'image/png' || $mime === 'image/gif') && ($this->watermark_method != "none" && $this->watermark_method != "only_visible") ) {
if (($mime === 'image/jpeg' || $mime === 'image/png' || $mime === 'image/gif') && $this->watermark_method != "none") {
$scriptPath = '/var/www/formr.org/scripts/watermark/main.py';
$originalImage = escapeshellarg($destination_path);
$watermarkedImage = $destination_path; // overwrite original file
Expand Down
24 changes: 10 additions & 14 deletions templates/admin/run/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<li><a href="#reminder" data-toggle="tab" aria-expanded="false">Reminder</a></li>
<li><a href="#overview_script" data-toggle="tab" aria-expanded="false">Overview</a></li>
<li><a href="#osf" data-toggle="tab" aria-expanded="false">OSF</a></li>
<li><a href="#watermark" data-toggle="tab" aria-expanded="false">Watermarks</a></li>
<li><a href="#watermark" data-toggle="tab" aria-expanded="false">Invisible watermarks</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="settings">
Expand Down Expand Up @@ -345,14 +345,13 @@
<form class="form-horizontal" enctype="multipart/form-data" id="run_settings" method="post" action="<?php echo admin_run_url($run->name, 'ajax_save_settings'); ?>">
<div class="col-md-12">
<div class="single_unit_display">
<h4>Watermarks</h4>
<p>You can embed a watermark into your uploaded images. The watermark
may help you identify your images and prove ownership.</p>
<p>You can choose between a visible and a human-invisible watermark. For
the invisible watermark, there are two methods: SIFT and Blind. The
SIFT approach may distort the image less but holds less information
(up to 31 chars, only ASCII chars) and requires an image-specific
key for extraction later. The Blind approach might distort the image
<h4>Invisible watermarks</h4>
<p>You can embed a human-invisible watermark into your uploaded images.
The watermark may help you identify your images and prove ownership.
For the watermark, there are two methods: SIFT and Blind. The SIFT
approach may distort the image less but holds less information (up
to 31 chars, only ASCII chars) and requires an image-specific key
for extraction later. The Blind approach might distort the image
more but holds more information (up to 255 chars) and uses a fixed
key for later extraction.</p>
<p>To extract an invisible watermark, you first need the watermark key,
Expand All @@ -366,11 +365,8 @@
<label title="Select to chose which watermarking method should be applied">Enable watermarks</label><div with="1rem" ></div>
<select name="watermark_method" class="form-control" style="padding: 0; border: none; height: 30px;" >
<option <?php echo $run->watermark_method === "none" ? "selected" : '' ?> value="none">None</option>
<option <?php echo $run->watermark_method === "only_visible" ? "selected" : '' ?> value="only_visible">Only visible</option>
<option <?php echo $run->watermark_method === "only_sift" ? "selected" : '' ?> value="only_sift">Only sift</option>
<option <?php echo $run->watermark_method === "only_blind" ? "selected" : '' ?> value="only_blind">Only blind</option>
<option <?php echo $run->watermark_method === "visible_and_sift" ? "selected" : '' ?> value="visible_and_sift">Visible and sift</option>
<option <?php echo $run->watermark_method === "visible_and_blind" ? "selected" : '' ?> value="visible_and_blind">Visible and blind</option>
<option <?php echo $run->watermark_method === "only_sift" ? "selected" : '' ?> value="only_sift">SIFT</option>
<option <?php echo $run->watermark_method === "only_blind" ? "selected" : '' ?> value="only_blind">Blind</option>
</select>
</div>
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/run/upload_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<li><i class="fa-li fa fa-cloud-upload"></i> We do not prevent users from sharing the links with others.
If your users see an image/video, there is no way of preventing them from re-sharing it, if you're not looking over their shoulders.<br>
Users can always take a photo of the screen, even if you could prevent screenshots. Hence, we saw no point in generating single-use links for the images (so that users can't share the picture directly). Please be aware of this and don't use formr to show confidential information in an un-supervised setting. However, because the links are large random numbers, it's fairly safe to use formr to upload confidential information to be shown in the lab, the images cannot be discovered by people who don't have access to the study.</li>
<li><i class="fa-li fa fa-info"></i> You can embed a watermark into your uploaded images. The watermark may help you identify your images and prove ownership. For more information and to enable a watermark, refer to the settings page of this run. If a human-invisible watermark is embedded, you will need a key to extract it. You can find the key in the table below for each image if a watermark was embedded in it.</li>
<li><i class="fa-li fa fa-info"></i> You can embed a human-invisible watermark into your uploaded images. The watermark may help you identify your images and prove ownership. For more information and to enable a watermark, refer to the settings page of this run. If a watermark is embedded, you will need a key to extract it. You can find the key in the table below for each image if a watermark was embedded in it.</li>
</ul>
</div>

Expand Down

0 comments on commit 2fdd644

Please sign in to comment.