From 80b6788638fe1ca62e6ec4682557a7e0af217c6a Mon Sep 17 00:00:00 2001 From: cacaodev Date: Sat, 28 Apr 2012 17:11:37 +0200 Subject: [PATCH] CPImage -initWithData: --- AppKit/CPImage.j | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AppKit/CPImage.j b/AppKit/CPImage.j index f82d65ddbd..70601d1284 100644 --- a/AppKit/CPImage.j +++ b/AppKit/CPImage.j @@ -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. */