-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add make test to npm test oops don't overwite files
- Loading branch information
1 parent
7072740
commit 65673f8
Showing
6 changed files
with
39 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,22 @@ | |
// gm - Copyright Aaron Heckmann <[email protected]> (MIT Licensed) | ||
|
||
var assert = require('assert'), | ||
fs = require('fs'); | ||
fs = require('fs'), | ||
os = require('os'), | ||
isLinux = os.platform() === 'linux'; | ||
|
||
module.exports = function (_, dir, finish, gm) { | ||
if (!gm.integration) | ||
return finish(); | ||
|
||
var filename = dir + '/autoOrient.jpg'; | ||
|
||
var beforeValues = { | ||
'Landscape_1.jpg': ['TopLeft', 1, '600x450'], | ||
'Landscape_2.jpg': ['TopRight', 2, '600x450'], | ||
'Landscape_3.jpg': ['BottomRight', 3, '600x450'], | ||
'Landscape_4.jpg': ['BottomLeft', 4, '600x450'], | ||
'Landscape_5.jpg': ['LeftTop', 5, '450x600'], | ||
'Landscape_6.jpg': ['RightTop', 6, '450x600'], | ||
'Landscape_7.jpg': ['RightBottom', 7, '450x600'], | ||
'Landscape_8.jpg': ['LeftBottom', 8, '450x600'], | ||
'Portrait_1.jpg': ['TopLeft', 1, '450x600'], | ||
'Portrait_2.jpg': ['TopRight', 2, '450x600'], | ||
'Portrait_3.jpg': ['BottomRight', 3, '450x600'], | ||
'Portrait_4.jpg': ['BottomLeft', 4, '450x600'], | ||
|
@@ -28,16 +26,15 @@ module.exports = function (_, dir, finish, gm) { | |
'Portrait_7.jpg': ['RightBottom', 7, '600x450'], | ||
'Portrait_8.jpg': ['LeftBottom', 8, '600x450'] | ||
}; | ||
|
||
var afterValues = { | ||
'Landscape_1.jpg': ['TopLeft', false, '600x450'], | ||
'Landscape_2.jpg': ['Unknown', true, '600x450'], | ||
'Landscape_3.jpg': ['Unknown', true, '600x450'], | ||
'Landscape_4.jpg': ['Unknown', true, '600x450'], | ||
'Landscape_5.jpg': ['Unknown', true, '600x450'], | ||
'Landscape_6.jpg': ['Unknown', true, '600x450'], | ||
'Landscape_7.jpg': ['Unknown', true, '600x450'], | ||
'Landscape_8.jpg': ['Unknown', true, '600x450'], | ||
'Portrait_1.jpg': ['TopLeft', false, '450x600'], | ||
'Portrait_2.jpg': ['Unknown', true, '450x600'], | ||
'Portrait_3.jpg': ['Unknown', true, '450x600'], | ||
'Portrait_4.jpg': ['Unknown', true, '450x600'], | ||
|
@@ -46,11 +43,20 @@ module.exports = function (_, dir, finish, gm) { | |
'Portrait_7.jpg': ['Unknown', true, '450x600'], | ||
'Portrait_8.jpg': ['Unknown', true, '450x600'] | ||
}; | ||
|
||
if (!isLinux) { | ||
// For whatever reason, linux doesn't work. | ||
beforeValues['Landscape_1.jpg'] = ['TopLeft', 1, '600x450'] | ||
beforeValues['Portrait_1.jpg'] = ['TopLeft', 1, '450x600'] | ||
afterValues['Landscape_1.jpg'] = ['TopLeft', false, '600x450'] | ||
afterValues['Portrait_1.jpg'] = ['TopLeft', false, '450x600'] | ||
} | ||
|
||
fs.readdir(dir + '/orientation/', function(err, files) { | ||
if (err) return finish(err); | ||
|
||
var originalFiles = files.filter(function(file) { | ||
return /\d\.jpg$/.test(file); | ||
return beforeValues[file] && afterValues[file]; | ||
}); | ||
|
||
function next () { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters