Changes

Jump to navigation Jump to search
25 bytes added ,  14:34, 29 October 2016
Line 2,027: Line 2,027:  
This implies applying operations to a source image (not only cropping, but all the others if applicable). We start from a source image (defined by a barcode and incremental id), apply cropping parameters (x1, y1, x2, y2), additional operations (white_magic, normalize)
 
This implies applying operations to a source image (not only cropping, but all the others if applicable). We start from a source image (defined by a barcode and incremental id), apply cropping parameters (x1, y1, x2, y2), additional operations (white_magic, normalize)
 
<br>
 
<br>
<pre>$.post('/cgi/product_image_crop.pl',
  −
{code: code, id: imagefield , imgid: imgid,
  −
x1:selection.x, y1:selection.y, x2:selection.x + selection.width, y2:selection.y + selection.height,
  −
angle:angles[imagefield], normalize:$("#normalize_" + imagefield).prop('checked'),
  −
white_magic:$("#white_magic_" + imagefield).prop('checked') }, function(data) {
  −
  −
imagefield_url[imagefield] = data.image.display_url;
  −
update_display(imagefield, false);
  −
$('div[id="cropbutton_' + imagefield +'"]').show();
  −
$('div[id="cropbuttonmsg_' + imagefield +'"]').html(Lang.image_saved);
  −
$(document).foundation('equalizer', 'reflow');
  −
}, 'json');
  −
}); </pre>
     −
<pre>
+
<pre>Test server: http://world.openfoodfacts.net/cgi/product_image_crop.pl</pre>
http://world.openfoodfacts.net/cgi/product_image_crop.pl?code=code&id=&angle=&normalize&white_magic&type=add&action=display&imgid=&x1=&y1=&x2=&y2=
+
<pre>Live server: http://world.openfoodfacts.org/cgi/product_image_crop.pl</pre>
</pre>
   
=====Values=====
 
=====Values=====
 
<pre>
 
<pre>
Line 2,059: Line 2,045:  
y2=the Y end of the crop
 
y2=the Y end of the crop
 
</pre>
 
</pre>
 +
 +
===== Ignore me =====
 +
<pre>$.post('/cgi/product_image_crop.pl',
 +
{code: code, id: imagefield , imgid: imgid,
 +
x1:selection.x, y1:selection.y, x2:selection.x + selection.width, y2:selection.y + selection.height,
 +
angle:angles[imagefield], normalize:$("#normalize_" + imagefield).prop('checked'),
 +
white_magic:$("#white_magic_" + imagefield).prop('checked') }, function(data) {
 +
 +
imagefield_url[imagefield] = data.image.display_url;
 +
update_display(imagefield, false);
 +
$('div[id="cropbutton_' + imagefield +'"]').show();
 +
$('div[id="cropbuttonmsg_' + imagefield +'"]').html(Lang.image_saved);
 +
$(document).foundation('equalizer', 'reflow');
 +
}, 'json');
 +
}); </pre>
    
==== Performing OCR on a photo ====
 
==== Performing OCR on a photo ====

Navigation menu