"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "js/modules/auto_orient_image.js" between
Signal-Desktop-1.35.2.tar.gz and Signal-Desktop-1.36.1.tar.gz

About: Signal-Desktop is a cross-platform encrypted messaging service (also available for mobile devices).

auto_orient_image.js  (Signal-Desktop-1.35.2):auto_orient_image.js  (Signal-Desktop-1.36.1)
const loadImage = require('blueimp-load-image'); const loadImage = require('blueimp-load-image');
const DEFAULT_JPEG_QUALITY = 0.85; const DEFAULT_JPEG_QUALITY = 0.85;
// File | Blob | URLString -> LoadImageOptions -> Promise<DataURLString> // File | Blob | URLString -> LoadImageOptions -> Promise<DataURLString>
// //
// Documentation for `options` (`LoadImageOptions`): // Documentation for `options` (`LoadImageOptions`):
// https://github.com/blueimp/JavaScript-Load-Image/tree/v2.18.0#options // https://github.com/blueimp/JavaScript-Load-Image/tree/v2.18.0#options
exports.autoOrientImage = (fileOrBlobOrURL, options = {}) => { exports.autoOrientImage = (fileOrBlobOrURL, options = {}) => {
const optionsWithDefaults = Object.assign( const optionsWithDefaults = {
{ type: 'image/jpeg',
type: 'image/jpeg', quality: DEFAULT_JPEG_QUALITY,
quality: DEFAULT_JPEG_QUALITY, ...options,
}, canvas: true,
options, orientation: true,
{ };
canvas: true,
orientation: true,
}
);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
loadImage( loadImage(
fileOrBlobOrURL, fileOrBlobOrURL,
canvasOrError => { canvasOrError => {
if (canvasOrError.type === 'error') { if (canvasOrError.type === 'error') {
const error = new Error('autoOrientImage: Failed to process image'); const error = new Error('autoOrientImage: Failed to process image');
error.cause = canvasOrError; error.cause = canvasOrError;
reject(error); reject(error);
return; return;
 End of changes. 1 change blocks. 
11 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)