WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
37621
Chromium/mac: Image thumbnails don't work for indexed images
https://bugs.webkit.org/show_bug.cgi?id=37621
Summary
Chromium/mac: Image thumbnails don't work for indexed images
Nico Weber
Reported
2010-04-14 16:13:11 PDT
WebKit bug for
http://crbug.com/41512
Attachments
Patch
(2.32 KB, patch)
2010-04-14 16:18 PDT
,
Nico Weber
no flags
Details
Formatted Diff
Diff
Patch
(2.53 KB, patch)
2010-04-15 13:01 PDT
,
Nico Weber
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Nico Weber
Comment 1
2010-04-14 16:18:01 PDT
Created
attachment 53382
[details]
Patch
Nico Weber
Comment 2
2010-04-14 16:19:29 PDT
The CoreGraphics docs say that CGCreateContext doesn't work with indexed color spaces. Always using RGB is probably better for CMYK images too.
Avi Drissman
Comment 3
2010-04-14 16:26:24 PDT
> Index: WebCore/platform/chromium/DragImageChromiumMac.cpp > =================================================================== > + CGColorSpaceRef deviceRGB = CGColorSpaceCreateDeviceRGB();
RetainPtr?
> + CGContextRef context = CGBitmapContextCreate(0, width, height, 8, width * 4, deviceRGB, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); > + CGColorSpaceRelease(deviceRGB); > +
BTW, the comment about CGCreateContext not working for indexed color spaces is IMHO comment-worthy in the code. Just me.
Avi Drissman
Comment 4
2010-04-15 07:50:08 PDT
> Index: WebCore/platform/chromium/DragImageChromiumMac.cpp > =================================================================== > + CGColorSpaceRef deviceRGB = CGColorSpaceCreateDeviceRGB();
BTW, CGColorSpaceCreateDeviceRGB hasn't created a device RGB color space since 10.3, so the variable name, technically speaking, is inaccurate. Since CGColorSpaceCreateDeviceRGB() == CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB), you should switch to the latter as it's clearer what's it's doing.
Nico Weber
Comment 5
2010-04-15 13:01:52 PDT
Created
attachment 53464
[details]
Patch Did the RetainPtr thing and even the CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB) suggestion. I didn't add a comment though, because just saying that createcontext doesn't work with indexed images misses the point. We really want RGB here, and not whatever weird color space the image might be in. (Also, the WebKit way apparently is to do `svn annotate` and then look at revision log/bug afaiu).
Avi Drissman
Comment 6
2010-04-15 13:08:56 PDT
(In reply to
comment #5
)
> (Also, the WebKit way apparently is to do `svn annotate` and then look at > revision log/bug afaiu).
Fine with me. Code LGTM.
Dimitri Glazkov (Google)
Comment 7
2010-04-15 13:10:47 PDT
Comment on
attachment 53464
[details]
Patch motownavi can't be wrong. rs=me.
WebKit Commit Bot
Comment 8
2010-04-15 16:58:58 PDT
Comment on
attachment 53464
[details]
Patch Clearing flags on attachment: 53464 Committed
r57687
: <
http://trac.webkit.org/changeset/57687
>
WebKit Commit Bot
Comment 9
2010-04-15 16:59:02 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug