Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed regression caused by CoffeeScript 1.9.0+ #377

Merged
merged 1 commit into from
Mar 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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