Bug 58387

Summary: make PrettyPatch.rb aware of checksums in png files
Product: WebKit Reporter: Tony Chang <tony>
Component: New BugsAssignee: Tony Chang <tony>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, aroben, dbates, ojan, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 56286    
Attachments:
Description Flags
Patch
none
git example
none
add nil checks none

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>