lib/modules/apostrophe-attachments/lib/tasks/rescale.js
function(callback) {
              async.forEachSeries(file.crops || [], function(crop, callback) {
                console.log('RECROPPING');
                var originalFile = '/attachments/' + file._id + '-' + file.name + '.' + crop.left + '.' + crop.top + '.' + crop.width + '.' + crop.height + '.' + file.extension;
                console.log("Cropping " + tempFile + " to " + originalFile);
                return self.uploadfs.copyImageIn(tempFile, originalFile, { crop: crop }, function(err) {
                  if (err) {
                    console.error('WARNING: problem copying image back into uploadfs:');
                    console.error(err);
                    return fileCallback(null);
                  }
                  return callback(null);
                });
              }, callback);
            }
function(callback) {
              async.forEachSeries(file.crops || [], function(crop, callback) {
                console.log('RECROPPING');
                var originalFile = '/attachments/' + file._id + '-' + file.name + '.' + crop.left + '.' + crop.top + '.' + crop.width + '.' + crop.height + '.' + file.extension;
                console.log("Cropping " + tempFile + " to " + originalFile);
                return self.uploadfs.copyImageIn(tempFile, originalFile, { crop: crop }, function(err) {
                  if (err) {
                    console.error('WARNING: problem copying image back into uploadfs:');
                    console.error(err);
                    return fileCallback(null);
                  }
                  return callback(null);
                });
              }, callback);
            }
function ( callback ) { async . forEachSeries ( file . crops || [ ] , function ( crop , callback ) { console . log ( 'RECROPPING' ) ; var originalFile = '/attachments/' + file . _id + '-' + file . name + '.' + crop . left + '.' + crop . top + '.' + crop . width + '.' + crop . height + '.' + file . extension ; console . log ( "Cropping " + tempFile + " to " + originalFile ) ; return self . uploadfs . copyImageIn ( tempFile , originalFile , { crop : crop } , function ( err ) { if ( err ) { console . error ( 'WARNING: problem copying image back into uploadfs:' ) ; console . error ( err ) ; return fileCallback ( null ) ; } return callback ( null ) ; } ) ; } , callback ) ; }
Don't forget to recrop as well!
Don t forget to recrop as well!