Skip to content

Commit

Permalink
Merge pull request #377 from leesdolphin/master
Browse files Browse the repository at this point in the history
Fixed regression caused by CoffeeScript 1.9.0+
  • Loading branch information
devongovett committed Mar 20, 2015
2 parents 5f93d67 + c0abc88 commit a797c1a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lib/font/tables/name.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module.exports = NameTable

class NameEntry
constructor: (@raw, entry) ->
@length = raw.length
@length = @raw.length
@platformID = entry.platformID
@encodingID = entry.encodingID
@languageID = entry.languageID
@languageID = entry.languageID
4 changes: 2 additions & 2 deletions lib/font/ttf.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class TTFFont
throw new Error 'Unknown font format in buffer: ' + e.message

constructor: (@rawData, name) ->
data = @contents = new Data(rawData)
data = @contents = new Data(@rawData)

if data.readString(4) is 'ttcf'
throw new Error "Must specify a font name for TTC files." if not name

Expand Down
28 changes: 14 additions & 14 deletions lib/image/jpeg.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ fs = require 'fs'
class JPEG
MARKERS = [0xFFC0, 0xFFC1, 0xFFC2, 0xFFC3, 0xFFC5, 0xFFC6, 0xFFC7,
0xFFC8, 0xFFC9, 0xFFCA, 0xFFCB, 0xFFCC, 0xFFCD, 0xFFCE, 0xFFCF]
constructor: (@data, @label) ->
if data.readUInt16BE(0) isnt 0xFFD8

constructor: (@data, @label) ->
if @data.readUInt16BE(0) isnt 0xFFD8
throw "SOI not found in JPEG"

pos = 2
while pos < data.length
marker = data.readUInt16BE(pos)
while pos < @data.length
marker = @data.readUInt16BE(pos)
pos += 2
break if marker in MARKERS
pos += data.readUInt16BE(pos)
pos += @data.readUInt16BE(pos)

throw "Invalid JPEG." unless marker in MARKERS
pos += 2
@bits = data[pos++]
@height = data.readUInt16BE(pos)

@bits = @data[pos++]
@height = @data.readUInt16BE(pos)
pos += 2
@width = data.readUInt16BE(pos)

@width = @data.readUInt16BE(pos)
pos += 2
channels = data[pos++]

channels = @data[pos++]
@colorSpace = switch channels
when 1 then 'DeviceGray'
when 3 then 'DeviceRGB'
Expand Down

0 comments on commit a797c1a

Please sign in to comment.