[Webkit-unassigned] [Bug 41779] [GTK] Implement ImageDiff and add it to the build system
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jul 8 10:49:07 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=41779
Gustavo Noronha (kov) <gns at gnome.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #60764|review? |review+
Flag| |
--- Comment #4 from Gustavo Noronha (kov) <gns at gnome.org> 2010-07-08 10:49:07 PST ---
(From update of attachment 60764)
102 void* diffBuffer = malloc(width * height);
[...]
110 unsigned char* diff = static_cast<unsigned char*>(diffBuffer);
[...]
143 *differenceImage = differenceImageFromDifferenceBuffer(static_cast<unsigned char*>(diffBuffer), width, height);
Given that you never use the diffBuffer as a void*, I would prefer having the cast in the malloc call, it makes it a bit easier on the reader of the code.
I find the mixed usage of g_print, fputs and fprintf unnecessary, though I do not oppose to it. I feel like you cal also make the ifs that are under the else ifs here be just one more condition of the else if:
206 if (imageSize > 0 && !actualImage) {
207 if (!(actualImage = readPixbufFromStdin(imageSize))) {
208 fputs("Error, could not read actual image.\n", stdout);
209 return 1;
210 }
211 } else if (imageSize > 0 && !baselineImage) {
212 if (!(baselineImage = readPixbufFromStdin(imageSize))) {
213 fputs("Error, could not read baseline image.\n", stdout);
214 return 1;
215 }
It will make it a bit easier to read, IMO. Other than the above comments, I think the code looks right, let's start getting some experience with how well pixel tests will work for us, I guess =)
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list