Bug 83152 - [GTK] Separate image encoding from dataURL construction
Summary: [GTK] Separate image encoding from dataURL construction
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: noel gordon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-04 06:07 PDT by noel gordon
Modified: 2012-04-10 19:59 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.75 KB, patch)
2012-04-04 06:23 PDT, noel gordon
no flags Details | Formatted Diff | Diff
Patch for landing (4.69 KB, patch)
2012-04-09 19:59 PDT, noel gordon
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description noel gordon 2012-04-04 06:07:41 PDT
[GTK] Separate image encoding from dataURL construction
Comment 1 noel gordon 2012-04-04 06:23:16 PDT
Created attachment 135575 [details]
Patch
Comment 2 Martin Robinson 2012-04-05 18:15:04 PDT
Comment on attachment 135575 [details]
Patch

This seems like a nice refactor, but is there some reason that it will be useful in the future?
Comment 4 Martin Robinson 2012-04-06 08:20:18 PDT
Comment on attachment 135575 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=135575&action=review

> Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp:70
> +    base64Encode(reinterpret_cast<const char*>(buffer.get()), bufferSize, base64Data);

It seems unusual that we need this reinpterpret_cast here. Perhaps you could try removing this before landing?
Comment 5 noel gordon 2012-04-09 19:57:24 PDT
Happy to try removing the reinterpret_cast<> and try landing.
Comment 6 noel gordon 2012-04-09 19:59:49 PDT
Created attachment 136382 [details]
Patch for landing
Comment 7 noel gordon 2012-04-09 20:09:29 PDT
Other questions: does the SupportedImageMIMETypeForEncoding registry for GTK contain items that don't begin with "image/"?  I'd be surprised, and it seems these lines are redundant, due to the ASSERT at the start of ImageBuffer::toDataURL() ...

http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp#L39

 39    if (!mimeType.startsWith("image/"))
 40        return "data:,";
Comment 8 noel gordon 2012-04-09 20:11:33 PDT
Oh, and is gdk_pixbuf_save_to_buffer() thread-safe?  I don't see anything in the docs about that.
Comment 9 WebKit Review Bot 2012-04-10 11:29:28 PDT
Comment on attachment 136382 [details]
Patch for landing

Clearing flags on attachment: 136382

Committed r113742: <http://trac.webkit.org/changeset/113742>
Comment 10 WebKit Review Bot 2012-04-10 11:29:33 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 noel gordon 2012-04-10 19:59:51 PDT
(In reply to comment #7)
> Other questions: does the SupportedImageMIMETypeForEncoding registry for GTK contain items that don't begin with "image/"?  I'd be surprised, and it seems these lines are redundant, due to the ASSERT at the start of ImageBuffer::toDataURL() ...
> 
> http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp#L39
> 
>  39    if (!mimeType.startsWith("image/"))
>  40        return "data:,";

Filed bug 83657 about that if you'd like to review.