Skip to content

Commit

Permalink
CPImage -initWithData:
Browse files Browse the repository at this point in the history
  • Loading branch information
cacaodev committed Apr 28, 2012
1 parent c437537 commit 80b6788
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions AppKit/CPImage.j
Expand Up @@ -158,6 +158,18 @@ function CPAppKitImage(aFilename, aSize)
return self;
}

/*!
Initializes the receiver with the specified data. The method loads the data into memory.
@param someData the CPData object representing the image
@return the initialized image
*/
- (id)initWithData:(CPData)someData
{
var dataURL = "data:image;base64," + [someData base64];

return [self initWithContentsOfFile:dataURL];
}

/*!
Returns the path of the file associated with this image.
*/
Expand Down

0 comments on commit 80b6788

Please sign in to comment.