mirror of https://github.com/OCA/web.git
[IMP] Remove extra padding from Image binary.
parent
b842bea6f6
commit
e2cb83d312
|
@ -7,8 +7,8 @@
|
||||||
"category": "web",
|
"category": "web",
|
||||||
"website": "https://github.com/OCA/web",
|
"website": "https://github.com/OCA/web",
|
||||||
"author": "Tech Receptives, "
|
"author": "Tech Receptives, "
|
||||||
"Odoo Community Association (OCA), "
|
"Kaushal Prajapati, "
|
||||||
"Kaushal Prajapati",
|
"Odoo Community Association (OCA)",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"data": [
|
"data": [
|
||||||
"views/assets.xml",
|
"views/assets.xml",
|
||||||
|
|
|
@ -91,7 +91,7 @@ odoo.define('web_widget_image_webcam.webcam_widget', function(require) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// From the above info, we doing the opposite stuff to find the approx size of Image in bytes.
|
// From the above info, we doing the opposite stuff to find the approx size of Image in bytes.
|
||||||
var approx_img_size = 3 * (img_data_base64.length / 4) // like... "3[n/4]"
|
var approx_img_size = 3 * (img_data_base64.length / 4) - (img_data_base64.match(/=+$/g) || []).length; // like... "3[n/4]"
|
||||||
|
|
||||||
// Upload image in Binary Field
|
// Upload image in Binary Field
|
||||||
self.on_file_uploaded(approx_img_size, "web-cam-preview.jpeg", "image/jpeg", img_data_base64);
|
self.on_file_uploaded(approx_img_size, "web-cam-preview.jpeg", "image/jpeg", img_data_base64);
|
||||||
|
|
Loading…
Reference in New Issue