Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Issue 916783003: Restrict salient image size before storing (Closed)

Created:
5 years, 10 months ago by Ian Wen
Modified:
5 years, 10 months ago
CC:
chromium-reviews, noyau+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Restrict salient image size before storing It is a waste of storage to save images that are larger than device display size. On tablet we should be even more aggressive about resizing those images, because showing them won't take up the entire screen. BUG=454623 Committed: https://crrev.com/f7b6773a958ef2cc742174a4dc9c1ab60e746bca Cr-Commit-Position: refs/heads/master@{#317628}

Patch Set 1 #

Patch Set 2 : #

Total comments: 6

Patch Set 3 : #

Total comments: 5

Patch Set 4 : use pixel instead of dp #

Total comments: 8

Patch Set 5 : Switch to dynamic size determination #

Total comments: 4

Patch Set 6 : Fix comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -23 lines) Patch
M chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc View 1 2 3 4 5 chunks +51 lines, -2 lines 1 comment Download
M components/enhanced_bookmarks/bookmark_image_service.h View 1 2 3 4 5 2 chunks +15 lines, -11 lines 0 comments Download
M components/enhanced_bookmarks/bookmark_image_service.cc View 1 2 3 3 chunks +11 lines, -10 lines 0 comments Download

Messages

Total messages: 20 (4 generated)
Ian Wen
noyau, could you please take a look at the changes in bookmark_image_service.h? Thanks!
5 years, 10 months ago (2015-02-11 19:57:39 UTC) #2
Ian Wen
5 years, 10 months ago (2015-02-11 19:58:16 UTC) #4
noyau (Ping after 24h)
https://codereview.chromium.org/916783003/diff/20001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/916783003/diff/20001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode264 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:264: base::Callback<gfx::Image(void)> task = Could you move this code in ...
5 years, 10 months ago (2015-02-12 08:34:42 UTC) #5
Ian Wen
Noyau@, I made ResizeImage a pure virtual method in bookmark image service and hope you ...
5 years, 10 months ago (2015-02-12 22:49:48 UTC) #6
Kibeom Kim (inactive)
https://codereview.chromium.org/916783003/diff/20001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/916783003/diff/20001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode52 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:52: max_length /= display_info.GetDIPScale(); IIRC, gfx::Image's DPI concept doesn't depend ...
5 years, 10 months ago (2015-02-12 23:24:15 UTC) #7
Ian Wen
https://codereview.chromium.org/916783003/diff/20001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/916783003/diff/20001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode52 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:52: max_length /= display_info.GetDIPScale(); On 2015/02/12 23:24:15, Kibeom Kim wrote: ...
5 years, 10 months ago (2015-02-13 00:52:42 UTC) #8
Kibeom Kim (inactive)
maybe forgot to upload the next patchset? https://codereview.chromium.org/916783003/diff/20001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.h File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.h (right): https://codereview.chromium.org/916783003/diff/20001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.h#newcode62 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.h:62: scoped_ptr<gfx::Size> max_size_; ...
5 years, 10 months ago (2015-02-13 05:08:53 UTC) #9
noyau (Ping after 24h)
https://codereview.chromium.org/916783003/diff/60001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/916783003/diff/60001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode54 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:54: max_length = std::min(max_length, int(500 * display_info.GetDIPScale())); The comment says ...
5 years, 10 months ago (2015-02-13 09:57:42 UTC) #10
Ian Wen
https://codereview.chromium.org/916783003/diff/60001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/916783003/diff/60001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode54 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:54: max_length = std::min(max_length, int(500 * display_info.GetDIPScale())); On 2015/02/13 09:57:42, ...
5 years, 10 months ago (2015-02-13 22:51:24 UTC) #11
noyau (Ping after 24h)
lgtm
5 years, 10 months ago (2015-02-15 10:06:06 UTC) #12
Kibeom Kim (inactive)
lgtm with nits https://codereview.chromium.org/916783003/diff/80001/components/enhanced_bookmarks/bookmark_image_service.cc File components/enhanced_bookmarks/bookmark_image_service.cc (right): https://codereview.chromium.org/916783003/diff/80001/components/enhanced_bookmarks/bookmark_image_service.cc#newcode217 components/enhanced_bookmarks/bookmark_image_service.cc:217: const GURL& page_url) { How about ...
5 years, 10 months ago (2015-02-17 21:32:59 UTC) #13
Ian Wen
https://codereview.chromium.org/916783003/diff/80001/components/enhanced_bookmarks/bookmark_image_service.cc File components/enhanced_bookmarks/bookmark_image_service.cc (right): https://codereview.chromium.org/916783003/diff/80001/components/enhanced_bookmarks/bookmark_image_service.cc#newcode217 components/enhanced_bookmarks/bookmark_image_service.cc:217: const GURL& page_url) { On 2015/02/17 21:32:59, Kibeom Kim ...
5 years, 10 months ago (2015-02-23 18:54:57 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/916783003/100001
5 years, 10 months ago (2015-02-23 18:56:59 UTC) #17
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 10 months ago (2015-02-23 19:50:02 UTC) #18
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/f7b6773a958ef2cc742174a4dc9c1ab60e746bca Cr-Commit-Position: refs/heads/master@{#317628}
5 years, 10 months ago (2015-02-23 19:50:53 UTC) #19
noyau (Ping after 24h)
5 years, 10 months ago (2015-02-26 12:56:12 UTC) #20
Message was sent while issue was closed.
https://codereview.chromium.org/916783003/diff/100001/chrome/browser/enhanced...
File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc
(right):

https://codereview.chromium.org/916783003/diff/100001/chrome/browser/enhanced...
chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:221:
((float)max_size_.height()) / image.Height());
This should be std::max, not std::min. What you are doing here is resizing the
image so its larger size fits into the max_size rect. What you want is the
smaller size to match, hence the need to pick the larger ratio.

Powered by Google App Engine
This is Rietveld 408576698