Skip to content

Commit

Permalink
Cleaned up source formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gomfunkel committed Apr 6, 2014
1 parent 141f43d commit 4ba0739
Show file tree
Hide file tree
Showing 7 changed files with 1,347 additions and 1,345 deletions.
29 changes: 15 additions & 14 deletions lib/exif/Buffer.js
Expand Up @@ -3,36 +3,37 @@
//

Buffer.prototype.getByte = function (offset) {
return this[offset];
return this[offset];
};

Buffer.prototype.getSignedByte = function (offset) {
return (this[offset] > 127) ? this[offset] - 256 : this[offset];
return (this[offset] > 127) ? this[offset] - 256 : this[offset];
};

Buffer.prototype.getShort = function (offset, bigEndian) {
var shortVal = (bigEndian) ? (this[offset] << 8) + this[offset + 1] : (this[offset + 1] << 8) + this[offset];
return (shortVal < 0) ? shortVal + 65536 : shortVal;
var shortVal = (bigEndian) ? (this[offset] << 8) + this[offset + 1] : (this[offset + 1] << 8) + this[offset];
return (shortVal < 0) ? shortVal + 65536 : shortVal;
};

Buffer.prototype.getSignedShort = function (offset, bigEndian) {
var shortVal = (bigEndian) ? (this[offset] << 8) + this[offset + 1] : (this[offset + 1] << 8) + this[offset];
return (shortVal > 32767) ? shortVal - 65536 : shortVal;
var shortVal = (bigEndian) ? (this[offset] << 8) + this[offset + 1] : (this[offset + 1] << 8) + this[offset];
return (shortVal > 32767) ? shortVal - 65536 : shortVal;
};

Buffer.prototype.getLong = function (offset, bigEndian) {
var longVal = (bigEndian) ? (((((this[offset] << 8) + this[offset + 1]) << 8) + this[offset + 2]) << 8) + this[offset + 3] : (((((this[offset + 3] << 8) + this[offset + 2]) << 8) + this[offset + 1]) << 8) + this[offset];
return (longVal < 0) ? longVal + 4294967296 : longVal;
var longVal = (bigEndian) ? (((((this[offset] << 8) + this[offset + 1]) << 8) + this[offset + 2]) << 8) + this[offset + 3] : (((((this[offset + 3] << 8) + this[offset + 2]) << 8) + this[offset + 1]) << 8) + this[offset];
return (longVal < 0) ? longVal + 4294967296 : longVal;
};

Buffer.prototype.getSignedLong = function (offset, bigEndian) {
var longVal = (bigEndian) ? (((((this[offset] << 8) + this[offset + 1]) << 8) + this[offset + 2]) << 8) + this[offset + 3] : (((((this[offset + 3] << 8) + this[offset + 2]) << 8) + this[offset + 1]) << 8) + this[offset];
return (longVal > 2147483647) ? longVal - 4294967296 : longVal;
var longVal = (bigEndian) ? (((((this[offset] << 8) + this[offset + 1]) << 8) + this[offset + 2]) << 8) + this[offset + 3] : (((((this[offset + 3] << 8) + this[offset + 2]) << 8) + this[offset + 1]) << 8) + this[offset];
return (longVal > 2147483647) ? longVal - 4294967296 : longVal;
};

Buffer.prototype.getString = function (offset, length) {
var string = [];
for (var i = offset; i < offset + length; i++)
string.push(String.fromCharCode(this[i]));
return string.join('');
var string = [];
for (var i = offset; i < offset + length; i++) {
string.push(String.fromCharCode(this[i]));
}
return string.join('');
};

0 comments on commit 4ba0739

Please sign in to comment.