Bug 58387 - make PrettyPatch.rb aware of checksums in png files
Summary: make PrettyPatch.rb aware of checksums in png files
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on:
Blocks: 56286
  Show dependency treegraph
 
Reported: 2011-04-12 15:54 PDT by Tony Chang
Modified: 2011-04-14 10:48 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.20 KB, patch)
2011-04-12 15:55 PDT, Tony Chang
no flags Details | Formatted Diff | Diff
git example (38.19 KB, text/html)
2011-04-12 15:55 PDT, Tony Chang
no flags Details
add nil checks (4.46 KB, patch)
2011-04-14 10:46 PDT, Tony Chang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2011-04-12 15:54:19 PDT
make PrettyPatch.rb aware of checksums in png files
Comment 1 Tony Chang 2011-04-12 15:55:09 PDT
Created attachment 89289 [details]
Patch
Comment 2 Tony Chang 2011-04-12 15:55:56 PDT
Created attachment 89290 [details]
git example
Comment 3 Tony Chang 2011-04-12 15:59:02 PDT
I don't actually know ruby, so let me know if I'm doing something weird.
Comment 4 Adam Roben (:aroben) 2011-04-13 05:55:00 PDT
Comment on attachment 89289 [details]
Patch

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

> Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:544
> +                    @image_urls = binary_contents.collect do |content|
> +                        "data:image/png;base64," + [content].pack("m")
> +                    end
> +
> +                    @image_checksums = binary_contents.collect do |content|
> +                        FileDiff.read_checksum_from_png(content)
> +                    end

These might read a little better if you used block syntax:

@image_urls = binary_contents.collect { |content| "data:image/png;base64," + [content].pack("m") }
Comment 5 Tony Chang 2011-04-13 11:04:41 PDT
Committed r83750: <http://trac.webkit.org/changeset/83750>
Comment 6 Simon Fraser (smfr) 2011-04-13 22:02:35 PDT
This caused bug 58510. I'm going to back it out.
Comment 7 Tony Chang 2011-04-14 10:46:05 PDT
Created attachment 89606 [details]
add nil checks
Comment 8 Tony Chang 2011-04-14 10:48:02 PDT
Committed r83870: <http://trac.webkit.org/changeset/83870>