Index: Source/core/html/HTMLCanvasElement.cpp |
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp |
index 492c0912d8324e6ebe948f49ab2677f6f9dea79e..235a4d9c1d175cb9e60987a11636150ceb70ff37 100644 |
--- a/Source/core/html/HTMLCanvasElement.cpp |
+++ b/Source/core/html/HTMLCanvasElement.cpp |
@@ -564,16 +564,14 @@ void HTMLCanvasElement::toBlob(FileCallback* callback, const String& mimeType, c |
} |
} |
- String encodingMimeType = toEncodingMimeType(mimeType); |
- |
ImageData* imageData = toImageData(BackBuffer); |
ScopedDisposal<ImageData> disposer(imageData); |
- // Perform image encoding |
Vector<char> encodedImage; |
- ImageDataBuffer(imageData->size(), imageData->data()->data()).encodeImage(encodingMimeType, qualityPtr, &encodedImage); |
- resultBlob = File::create(encodedImage.data(), encodedImage.size(), encodingMimeType); |
+ String encodedMimeType; |
+ ImageDataBuffer(imageData->size(), imageData->data()->data()).encodeImage(toEncodingMimeType(mimeType), qualityPtr, &encodedImage, &encodedMimeType); |
+ resultBlob = File::create(encodedImage.data(), encodedImage.size(), encodedMimeType); |
Platform::current()->mainThread()->postTask(FROM_HERE, bind(&FileCallback::handleEvent, callback, resultBlob)); |
} |